aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/doc/src/inet.xml
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2011-06-28 14:00:10 +0200
committerHans Bolinder <[email protected]>2011-08-25 15:37:11 +0200
commitc6f772a04eafccf03d20b0bbda08c399b4640f38 (patch)
tree2f874162ed8ff7cd9d10d9472d7b771862d20eed /lib/kernel/doc/src/inet.xml
parentd48eaa0731017e5cdadca0af77ac14cd949b6c67 (diff)
downloadotp-c6f772a04eafccf03d20b0bbda08c399b4640f38.tar.gz
otp-c6f772a04eafccf03d20b0bbda08c399b4640f38.tar.bz2
otp-c6f772a04eafccf03d20b0bbda08c399b4640f38.zip
Improve types and specifications of the inet modules
Diffstat (limited to 'lib/kernel/doc/src/inet.xml')
-rw-r--r--lib/kernel/doc/src/inet.xml58
1 files changed, 17 insertions, 41 deletions
diff --git a/lib/kernel/doc/src/inet.xml b/lib/kernel/doc/src/inet.xml
index fd843b00d9..b36c28e027 100644
--- a/lib/kernel/doc/src/inet.xml
+++ b/lib/kernel/doc/src/inet.xml
@@ -105,6 +105,9 @@ fe80::204:acff:fe17:bf38
<name name="ip6_address"/>
</datatype>
<datatype>
+ <name name="port_number"/>
+ </datatype>
+ <datatype>
<name name="posix"/>
<desc><p>An atom which is named from the Posix error codes
used in Unix, and in the runtime libraries of most
@@ -119,7 +122,7 @@ fe80::204:acff:fe17:bf38
</desc>
</datatype>
<datatype>
- <name name="family_option"/>
+ <name name="address_family"/>
</datatype>
</datatypes>
@@ -250,26 +253,15 @@ fe80::204:acff:fe17:bf38
</func>
<func>
- <name>getopts(Socket, Options) -> {ok, OptionValues} | {error, posix()}</name>
+ <name name="getopts" arity="2"/>
<fsummary>Get one or more options for a socket</fsummary>
- <type>
- <v>Socket = term()</v>
- <v>Options = [Opt | RawOptReq]</v>
- <v>Opt = atom()</v>
- <v>RawOptReq = {raw, Protocol, OptionNum, ValueSpec}</v>
- <v>Protocol = integer()</v>
- <v>OptionNum = integer()</v>
- <v>ValueSpec = ValueSize | ValueBin</v>
- <v>ValueSize = integer()</v>
- <v>ValueBin = binary()</v>
- <v>OptionValues = [{Opt, Val} | {raw, Protocol, OptionNum, ValueBin}]</v>
- </type>
<type name="socket_getopt"/>
+ <type name="socket_setopt"/>
<desc>
<p>Gets one or more options for a socket.
See <seealso marker="#setopts/2">setopts/2</seealso>
for a list of available options.</p>
- <p>The number of elements in the returned <c>OptionValues</c>
+ <p>The number of elements in the returned <c><anno>OptionValues</anno></c>
list does not necessarily correspond to the number of options
asked for. If the operating system fails to support an option,
it is simply left out in the returned list. An error tuple is only
@@ -277,12 +269,12 @@ fe80::204:acff:fe17:bf38
(i.e. the socket is closed or the buffer size in a raw request
is too large). This behavior is kept for backward
compatibility reasons.</p>
- <p>A <c>RawOptReq</c> can be used to get information about
+ <p>A raw option request <c>RawOptReq = {raw, Protocol, OptionNum, ValueSpec}</c> can be used to get information about
socket options not (explicitly) supported by the emulator. The
use of raw socket options makes the code non portable, but
allows the Erlang programmer to take advantage of unusual features
present on the current platform.</p>
- <p>The <c>RawOptReq</c> consists of the tag <c>raw</c> followed
+ <p>The <c>RawOptReq</c> consists of the tag <c>raw</c> followed
by the protocol level, the option number and either a binary
or the size, in bytes, of the
buffer in which the option value is to be stored. A binary
@@ -325,19 +317,14 @@ fe80::204:acff:fe17:bf38
</func>
<func>
- <name>getstat(Socket)</name>
- <name>getstat(Socket, Options) -> {ok, OptionValues} | {error, posix()}</name>
+ <name name="getstat" arity="1"/>
+ <name name="getstat" arity="2"/>
<fsummary>Get one or more statistic options for a socket</fsummary>
- <type>
- <v>Socket = term()</v>
- <v>Options = [Opt]</v>
- <v>OptionValues = [{Opt, Val}]</v>
- <v>&nbsp;Opt, Val -- see below</v>
- </type>
+ <type name="stat_option"/>
<desc>
<p>Gets one or more statistic options for a socket.</p>
- <p><c>getstat(Socket)</c> is equivalent to
- <c>getstat(Socket,&nbsp;[recv_avg,&nbsp;recv_cnt,&nbsp;recv_dvi,&nbsp;recv_max,&nbsp;recv_oct,&nbsp;send_avg,&nbsp;send_cnt,&nbsp;send_dvi,&nbsp;send_max,&nbsp;send_oct])</c></p>
+ <p><c>getstat(<anno>Socket</anno>)</c> is equivalent to
+ <c>getstat(<anno>Socket</anno>,&nbsp;[recv_avg,&nbsp;recv_cnt,&nbsp;recv_dvi,&nbsp;recv_max,&nbsp;recv_oct,&nbsp;send_avg,&nbsp;send_cnt,&nbsp;send_dvi,&nbsp;send_max,&nbsp;send_oct])</c></p>
<p>The following options are available:</p>
<taglist>
<tag><c>recv_avg</c></tag>
@@ -394,12 +381,8 @@ fe80::204:acff:fe17:bf38
</desc>
</func>
<func>
- <name>port(Socket) -> {ok, Port} | {error, any()}</name>
+ <name name="port" arity="1"/>
<fsummary>Return the local port number for a socket</fsummary>
- <type>
- <v>Socket = socket()</v>
- <v>Port = integer()</v>
- </type>
<desc>
<p>Returns the local port number for a socket.</p>
</desc>
@@ -412,16 +395,9 @@ fe80::204:acff:fe17:bf38
</desc>
</func>
<func>
- <name>setopts(Socket, Options) -> ok | {error, posix()}</name>
+ <name name="setopts" arity="2"/>
<fsummary>Set one or more options for a socket</fsummary>
- <type>
- <v>Socket = term()</v>
- <v>Options = [{Opt, Val} | {raw, Protocol, Option, ValueBin}]</v>
- <v>Protocol = integer()</v>
- <v>OptionNum = integer()</v>
- <v>ValueBin = binary()</v>
- <v>&nbsp;Opt, Val -- see below</v>
- </type>
+ <type name="socket_setopt"/>
<desc>
<p>Sets one or more options for a socket. The following options
are available:</p>