From 16e895198a541ccbbbe6c970bd9572cf347a9c77 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Wed, 8 Jun 2016 14:46:44 +0200 Subject: Document the local (unix) address family --- lib/kernel/doc/src/gen_tcp.xml | 21 +++++++++-------- lib/kernel/doc/src/gen_udp.xml | 19 ++++++++------- lib/kernel/doc/src/inet.xml | 53 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 18 deletions(-) (limited to 'lib/kernel/doc/src') diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml index b75d42d198..88135ea43d 100644 --- a/lib/kernel/doc/src/gen_tcp.xml +++ b/lib/kernel/doc/src/gen_tcp.xml @@ -153,17 +153,17 @@ do_recv(Sock, Bs) -> Address can be a hostname or an IP address.

The following options are available:

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

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

- {ifaddr, ip_address()} -

Same as {ip, ip_address()}. If the host has many + {ifaddr, Address} +

Same as {ip, Address}. If the host has many network interfaces, this option specifies which one 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. If {ip, ip_address()} and/or + for it. If {ip, Address} and/or {port, port_number()} is combined with this option, the fd is bound to the specified interface and port before connecting. If these options are not specified, it is assumed that @@ -175,9 +175,10 @@ do_recv(Sock, Bs) -> local

- Sets up the socket for local address family. This option is only - valid together with {fd, integer()} when the file descriptor - is of local address family (e.g. a Unix Domain Socket) + Sets up a Unix Domain Socket. See + + inet:local_address() +

{port, Port} @@ -254,7 +255,7 @@ do_recv(Sock, Bs) ->

B is an integer >= 0. The backlog value defines the maximum length that the queue of pending connections can grow to. Defaults to 5.

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

If the host has many network interfaces, this option specifies which one to listen on.

{port, Port} @@ -263,8 +264,8 @@ do_recv(Sock, Bs) ->

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

- {ifaddr, ip_address()} -

Same as {ip, ip_address()}. If the host has many + {ifaddr, Address} +

Same as {ip, Address}. If the host has many network interfaces, this option specifies which one to use.

inet6 diff --git a/lib/kernel/doc/src/gen_udp.xml b/lib/kernel/doc/src/gen_udp.xml index ca9d9c978c..3f88a0272d 100644 --- a/lib/kernel/doc/src/gen_udp.xml +++ b/lib/kernel/doc/src/gen_udp.xml @@ -85,11 +85,11 @@

Received Packet is delivered as a list.

binary

Received Packet is delivered as a binary.

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

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

- {ifaddr, ip_address()} -

Same as {ip, ip_address()}. If the host has many + {ifaddr, Address} +

Same as {ip, Address}. If the host has many network interfaces, this option specifies which one to use.

{fd, integer() >= 0} @@ -107,9 +107,10 @@ local

- Sets up the socket for local address family. This option is only - valid together with {fd, integer()} when the file descriptor - is of local address family (e.g. a Unix Domain Socket) + Sets up a Unix Domain Socket. See + + inet:local_address() +

{udp_module, module()} @@ -184,8 +185,10 @@ Send a packet. -

Sends a packet to the specified address and port. Argument - Address can be a hostname or an IP address.

+

+ Sends a packet to the specified address and port. Argument + Address can be a hostname or a socket address. +

diff --git a/lib/kernel/doc/src/inet.xml b/lib/kernel/doc/src/inet.xml index 5ff167bcb3..c0dce2f50c 100644 --- a/lib/kernel/doc/src/inet.xml +++ b/lib/kernel/doc/src/inet.xml @@ -117,6 +117,59 @@ fe80::204:acff:fe17:bf38 + + + +

+ This address family only works on Unix-like systems. +

+

+ File is normally a file pathname + in a local filesystem. It is limited in length by the + operating system, traditionally to 108 bytes. +

+

+ A binary() is passed as is to the operating system, + but a string() is encoded according to the + + system filename encoding mode. + +

+

+ Other addresses are possible, for example Linux implements + "Abstract Addresses". See the documentation for + Unix Domain Sockets on your system, + normally unix in manual section 7. +

+

+ In most API functions where you can use + this address family the port number must be 0. +

+
+
+ + + + + + +

+ Addresses besides + + ip_address() + + ones that are returned from socket API functions. + See in particular + + local_address(). + + The unspec family corresponds to AF_UNSPEC and can + occur if the other side has no socket address. + The undefined family can only occur in the unlikely + event of an address family that the VM does not recognize. +

+
+
-- cgit v1.2.3