From 14867ef618386d5008adf19b8d7a76e56f869145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Thu, 12 Apr 2012 15:36:59 +0200 Subject: kernel: Initial doc of forgotten inet options * UDP: ulticast_if, multicast_loop and multicast_ttl, add_membership and drop_membership * Inet: bit8, buffer, deliver, high_watermark, linger and low_watermark --- lib/kernel/doc/src/gen_sctp.xml | 26 +------------ lib/kernel/doc/src/gen_tcp.xml | 37 ++++++++++-------- lib/kernel/doc/src/gen_udp.xml | 38 ++++++++++++++++++ lib/kernel/doc/src/inet.xml | 86 ++++++++++++++++++++++++++++++++++++++++- 4 files changed, 145 insertions(+), 42 deletions(-) (limited to 'lib') diff --git a/lib/kernel/doc/src/gen_sctp.xml b/lib/kernel/doc/src/gen_sctp.xml index 579b7f1f74..291aee62b1 100644 --- a/lib/kernel/doc/src/gen_sctp.xml +++ b/lib/kernel/doc/src/gen_sctp.xml @@ -530,19 +530,8 @@ SCTP data interleaved with other inter-process messages.

- - {buffer, integer()} - -

Determines the size of the user-level software buffer used by - the SCTP driver. Not to be confused with sndbuf - and recbuf options which correspond to - the kernel socket buffers. It is recommended - to have val(buffer) >= max(val(sndbuf),val(recbuf)). - In fact, the val(buffer) is automatically set to - the above maximum when sndbuf or recbuf values are set.

-
- {tos, integer()} + {tos, integer()}

Sets the Type-Of-Service field on the IP datagrams being sent, to the given value, which effectively determines a prioritization @@ -567,19 +556,8 @@ {IP,Port} of the socket can be re-used immediately: no waiting in the CLOSE_WAIT state is performed (may be required for high-throughput servers).

- -
- {linger, {true|false, integer()} - -

Determines the timeout in seconds for flushing unsent data in the - gen_sctp:close/1 socket call. If the 1st component of the value - tuple is false, the 2nd one is ignored, which means that - gen_sctp:close/1 returns immediately not waiting - for data to be flushed. Otherwise, the 2nd component is - the flushing time-out in seconds.

-
- {sndbuf, integer()} + {sndbuf, integer()}

The size, in bytes, of the *kernel* send buffer for this socket. Sending errors would occur for datagrams larger than diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml index cf97607af1..32a0f9b0d7 100644 --- a/lib/kernel/doc/src/gen_tcp.xml +++ b/lib/kernel/doc/src/gen_tcp.xml @@ -96,37 +96,42 @@ do_recv(Sock, Bs) -> can be either a hostname, or an IP address.

The available options are:

- list - -

Received Packet is delivered as a list.

-
- binary - -

Received Packet is delivered as a binary.

-
- {ip, ip_address()} + {ip, ip_address()}

If the host has several network interfaces, this option specifies which one to use.

- {port, Port} - -

Specify which local port number to use.

-
+ {fd, integer() >= 0}

If a socket has somehow been connected without using gen_tcp, use this option to pass the file descriptor for it.

- inet6 + + {ifaddr, ip_address()} +

TODO: Document

+
+ + inet +

Set up the socket for IPv4.

+
+ + inet6 +

Set up the socket for IPv6.

- inet + + {port, Port} -

Set up the socket for IPv4.

+

Specify which local port number to use.

+ + {tcp_module, module()} +

TODO: Document

+
+ Opt

See diff --git a/lib/kernel/doc/src/gen_udp.xml b/lib/kernel/doc/src/gen_udp.xml index daa9b7d887..0b2cd3d765 100644 --- a/lib/kernel/doc/src/gen_udp.xml +++ b/lib/kernel/doc/src/gen_udp.xml @@ -86,6 +86,44 @@

Set up the socket for IPv4.

+ + {multicast_if, Address} + +

Set the local device for a multicast socket.

+
+ + {multicast_loop, true | false} + +

+ When true sent multicast packets will be looped back to the local + sockets. +

+
+ + {multicast_ttl, Integer} + +

+ The multicast_ttl option changes the time-to-live (TTL) for + outgoing multicast datagrams in order to control the scope of the + multicasts. +

+

+ Datagrams with a TTL of 1 are not forwarded beyond the local + network. +
Default: 1 +

+
+ + {add_membership, {MultiAddress, InterfaceAddress}} + +

Join a multicast group.

+
+ + {drop_membership, {MultiAddress, InterfaceAddress}} + +

Leave multicast group.

+
+ Opt

See diff --git a/lib/kernel/doc/src/inet.xml b/lib/kernel/doc/src/inet.xml index bf6c4cfb1a..05946f1f18 100644 --- a/lib/kernel/doc/src/inet.xml +++ b/lib/kernel/doc/src/inet.xml @@ -445,10 +445,27 @@ fe80::204:acff:fe17:bf38 flow control; the other side will not be able send faster than the receiver can read.

+ + {bit8, clear | set | on | off} +

TODO: Document

+
+ {broadcast, Boolean}(UDP sockets)

Enable/disable permission to send broadcasts.

+ + {buffer, Size} + +

Determines the size of the user-level software buffer used by + the driver. Not to be confused with sndbuf + and recbuf options which correspond to + the kernel socket buffers. It is recommended + to have val(buffer) >= max(val(sndbuf),val(recbuf)). + In fact, the val(buffer) is automatically set to + the above maximum when sndbuf or recbuf values are set.

+
+ {delay_send, Boolean}

Normally, when an Erlang process sends to a socket, @@ -463,10 +480,19 @@ fe80::204:acff:fe17:bf38 real property of the socket. Needless to say it is an implementation specific option. Default is false.

+ + {deliver, port | term} +

When {active, true} delivers data on the forms + port : {S, {data, [H1,..Hsz | Data]}} or + term : {tcp, S, [H1..Hsz | Data]}. +

+
+ {dontroute, Boolean}

Enable/disable routing bypass for outgoing messages.

+ {exit_on_close, Boolean}

By default this option is set to true.

@@ -476,6 +502,7 @@ fe80::204:acff:fe17:bf38 gen_tcp:shutdown/2 to shutdown the write side.

+ {header, Size}

This option is only meaningful if the binary @@ -487,6 +514,15 @@ fe80::204:acff:fe17:bf38 example Size == 2, the data received will match [Byte1,Byte2|Binary].

+ + {high_watermark, Size} +

+ Sender is forced busy if sent and equeued data + readched the highwater mark. +
Default: 8192 kB. +

+
+ {keepalive, Boolean}(TCP/IP sockets)

Enables/disables periodic transmission on a connected @@ -495,6 +531,41 @@ fe80::204:acff:fe17:bf38 considered broken and an error message will be sent to the controlling process. Default disabled.

+ + {linger, {true|false, Seconds}} + +

Determines the timeout in seconds for flushing unsent data in the + close/1 socket call. If the 1st component of the value + tuple is false, the 2nd one is ignored, which means that + close/1 returns immediately not waiting + for data to be flushed. Otherwise, the 2nd component is + the flushing time-out in seconds.

+
+ + {low_watermark, Size} +

+ If the port has reached its high_watermark it will + force busy onto senders. When the port data queue reaches the + low_watermark callers are no longer forced busy. +
Default: 4096 kB. +

+
+ + {mode, Mode :: binary | list} + +

Received Packet is delivered as defined by Mode.

+
+ + list + +

Received Packet is delivered as a list.

+
+ + binary + +

Received Packet is delivered as a binary.

+
+ {nodelay, Boolean}(TCP/IP sockets)

If Boolean == true, the TCP_NODELAY option @@ -578,6 +649,16 @@ fe80::204:acff:fe17:bf38 indicated length are accepted and not considered invalid due to internal buffer limitations.

+ + {priority, Priority} +

Set the protocol-defined priority for all packets to be sent + on this socket.

+
+ + {raw, Protocol, OptionNum, ValueBin} +

See below.

+
+ {read_packets, Integer}(UDP sockets)

Sets the max number of UDP packets to read without @@ -589,7 +670,7 @@ fe80::204:acff:fe17:bf38 high the system can become unresponsive due to UDP packet flooding.

- {recbuf, Integer} + {recbuf, Size}

Gives the size of the receive buffer to use for the socket.

@@ -620,7 +701,7 @@ fe80::204:acff:fe17:bf38 Default is false due to backward compatibility.

- {sndbuf, Integer} + {sndbuf, Size}

Gives the size of the send buffer to use for the socket.

@@ -639,6 +720,7 @@ fe80::204:acff:fe17:bf38 not implemented. Use with caution.

+

In addition to the options mentioned above, raw option specifications can be used. The raw options are specified as a tuple of arity four, beginning with the tag -- cgit v1.2.3