From bc98fe2a55bfb54b39b0027213a7de60c14925c5 Mon Sep 17 00:00:00 2001 From: Dimitris Zorbas Date: Sun, 26 Nov 2017 20:48:03 +0000 Subject: Add typespecs to inet:i --- lib/kernel/src/inet.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl index dc20c21c77..fe91b0d33e 100644 --- a/lib/kernel/src/inet.erl +++ b/lib/kernel/src/inet.erl @@ -72,7 +72,7 @@ %% timer interface -export([start_timer/1, timeout/1, timeout/2, stop_timer/1]). --export_type([address_family/0, hostent/0, hostname/0, ip4_address/0, +-export_type([address_family/0, socket_protocol/0, hostent/0, hostname/0, ip4_address/0, ip6_address/0, ip_address/0, port_number/0, local_address/0, socket_address/0, returned_non_ip_address/0, socket_setopt/0, socket_getopt/0, @@ -1452,11 +1452,14 @@ fdopen(Fd, Addr, Port, Opts, Protocol, Family, Type, Module) -> %% socket stat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-spec i() -> ok. i() -> i(tcp), i(udp), i(sctp). +-spec i(socket_protocol()) -> ok. i(Proto) -> i(Proto, [port, module, recv, sent, owner, local_address, foreign_address, state, type]). +-spec i(socket_protocol(), [atom()]) -> ok. i(tcp, Fs) -> ii(tcp_sockets(), Fs, tcp); i(udp, Fs) -> -- cgit v1.2.3 From 4a3be82b5891b1aaf6f89f2ce1241986bb4d6c28 Mon Sep 17 00:00:00 2001 From: Dimitris Zorbas Date: Sun, 26 Nov 2017 20:48:44 +0000 Subject: Add documentation to :inet.i Also fix a typo. --- lib/kernel/doc/src/inet.xml | 60 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/lib/kernel/doc/src/inet.xml b/lib/kernel/doc/src/inet.xml index 169a76463b..abb045b744 100644 --- a/lib/kernel/doc/src/inet.xml +++ b/lib/kernel/doc/src/inet.xml @@ -197,6 +197,9 @@ fe80::204:acff:fe17:bf38 + + + @@ -460,6 +463,61 @@ get_tcpi_sacked(Sock) -> + + + + + Displays information and statistics about sockets on the terminal + +

+ Lists all TCP, UDP and SCTP sockets, including those that the Erlang runtime system uses as well as + those created by the application. +

+

+ The following options are available: +

+ + + port + +

The internal index of the port.

+
+ module + +

The callback module of the socket.

+
+ recv + +

Number of bytes received by the socket.

+
+ sent + +

Number of bytes sent from the socket.

+
+ owner + +

The socket owner process.

+
+ local_address + +

The local address of the socket.

+
+ foreign_address + +

The address and port of the other end of the connection.

+
+ state + +

The connection state.

+
+ type + +

STREAM or DGRAM or SEQPACKET.

+
+
+
+
+ Convert IPv6/IPV4 address to ASCII. @@ -1214,7 +1272,7 @@ inet:setopts(Sock,[{raw,6,8,<<30:32/native>>}]),]]> For one-to-many style sockets, the special value 0 is defined to mean that the returned addresses must be without any particular association. - How different SCTP implementations interprets this varies somewhat. + How different SCTP implementations interpret this varies somewhat.

-- cgit v1.2.3