From 0694dfbc731c109fa19bacdc86fe661f14bc1a12 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 17 Jul 2018 16:43:34 +0200 Subject: [socket-doc-nif] Add preliminary users guide Added a very preliminary users guide. Currently where we place the socket option tables. OTP-14831 --- erts/doc/src/Makefile | 1 + erts/doc/src/part.xml | 1 + erts/doc/src/socket_usage.xml | 451 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 453 insertions(+) create mode 100644 erts/doc/src/socket_usage.xml diff --git a/erts/doc/src/Makefile b/erts/doc/src/Makefile index 9a2750b751..bd2528c536 100644 --- a/erts/doc/src/Makefile +++ b/erts/doc/src/Makefile @@ -82,6 +82,7 @@ XML_CHAPTER_FILES = \ driver.xml \ absform.xml \ inet_cfg.xml \ + socket_usage.xml \ erl_ext_dist.xml \ erl_dist_protocol.xml \ communication.xml \ diff --git a/erts/doc/src/part.xml b/erts/doc/src/part.xml index 05e9a24af8..f0b8a00b90 100644 --- a/erts/doc/src/part.xml +++ b/erts/doc/src/part.xml @@ -42,6 +42,7 @@ + diff --git a/erts/doc/src/socket_usage.xml b/erts/doc/src/socket_usage.xml new file mode 100644 index 0000000000..b4880c3989 --- /dev/null +++ b/erts/doc/src/socket_usage.xml @@ -0,0 +1,451 @@ + + + + +
+ + 20182018 + Ericsson AB. All Rights Reserved. + + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + + Socket Usage + Micael Karlberg + + 2018-07-17 + PA1 + socket_usage.xml +
+ +
+ Introduction +

The socket interface (module) is basically an "thin" layer on top of + the OS socket interface. It is assumed that, unless you have special needs, + gen_[tcp|udp|sctp] should be sufficent.

+
+ +
+ Socket Options + +

Options for level otp:

+ + + Option Name + Value Type + Set + Get + Other + + + debug + boolean() + yes + yes + none + + + iow + boolean() + yes + yes + none + + + controlling_process + pid() + yes + yes + none + +
+ +

Options for level socket:

+ + + Option Name + Value Type + Set + Get + Other + + + acceptcon + boolean() + no + yes + none + + + bindtodevice + string() + yes + yes + none + + + broadcast + boolean() + yes + yes + type = dgram + + + debug + integer() + yes + yes + may require admin capability + + + domain + domain() + no + yes + none + + + dontroute + boolean() + yes + yes + none + + + keepalive + boolean() + yes + yes + none + + + linger + abort | linger() + yes + yes + none + + + oobinline + boolean() + yes + yes + none + + + peep_off + integer() + yes + yes + domain = local (unix) + + + priority + integer() + yes + yes + none + + + protocol + protocol() + no + yes + none + + + rcvbuf + integer() + yes + yes + none + + + reuseaddr + boolean() + yes + yes + none + + + reuseport + boolean() + yes + yes + domain = inet | inet6 + + + sndbuf + integer() + yes + yes + none + +
+ +

Options for level ip:

+ + + Option Name + Value Type + Set + Get + Other + + + add_membership + ip_mreq() + yes + no + none + + + add_source_membership + ip_mreq_source() + yes + no + none + + + block_source + ip_mreq_source() + yes + no + none + + + drop_membership + ip_mreq() + yes + no + none + + + drop_source_membership + ip_mreq_source() + yes + no + none + + + minttl + integer() + yes + yes + type = raw + + + mtu + integer() + no + yes + type = raw + + + mtu_discover + ip_mtu_discover() + yes + yes + none + + + multicast_all + boolean() + yes + yes + none + + + multicast_if + any | ip4_address() + yes + yes + none + + + multicast_loop + boolean() + yes + yes + none + + + multicast_ttl + 0..255 + yes + yes + none + + + nodefrag + boolean() + yes + yes + type = raw + + + recvif + boolean() + yes + yes + type = dgram | raw + + + recvttl + boolean() + yes + yes + type =/= stream + + + router_alert + integer() + yes + yes + type = raw + + + tos + ip_tos() + yes + yes + none + + + tos + integer() + yes + yes + none + + + unblock_source + ip_mreq_source() + yes + no + none + +
+ +

Options for level ipv6:

+ + + Option Name + Value Type + Set + Get + Other + + + add_membership + ipv6_mreq() + yes + no + none + + + drop_membership + ipv6_mreq() + yes + no + none + + + hoplimit + boolean() + yes + no + type = dgram | raw + +
+ +

Options for level tcp:

+ + + Option Name + Value Type + Set + Get + Other + + + congestion + string() + yes + yes + none + + + maxseg + integer() + yes + yes + type = stream, protocol = tcp + + + nodelay + boolean() + yes + yes + type = stream, protocol = tcp + +
+ +

Options for level udp:

+ + + Option Name + Value Type + Set + Get + Other + + + cork + boolean() + yes + yes + type = dgram, protocol = udp + +
+ +

Options for level sctp:

+ + + Option Name + Value Type + Set + Get + Other + + + autoclose + integer() + yes + yes + protocol = sctp + + + nodelay + boolean() + yes + yes + protocol = sctp + +
+ +
+
+ -- cgit v1.2.3