diff options
author | Micael Karlberg <bmk@erlang.org> | 2021-02-26 11:58:48 +0100 |
---|---|---|
committer | Micael Karlberg <bmk@erlang.org> | 2021-02-26 11:58:48 +0100 |
commit | 07e73c479cb0a5bf83509d6c7859773adcb45b56 (patch) | |
tree | 1301bc77b1e8999665e820abf2772c1bc64aecea | |
parent | af06b432876f397a07c31ec3080b38f750202f24 (diff) | |
download | erlang-07e73c479cb0a5bf83509d6c7859773adcb45b56.tar.gz |
[kernel|gen-tcp-socket|doc] Document option nodelay discrepancy
We do *not* hide that the nodelay option does not work when
used with Unix Domain Sockets when gen_tcp is used with
inet_backend = socket (which it is when used with
inet_backend = inet). This is now documented.
OTP-17156
-rw-r--r-- | lib/kernel/doc/src/gen_tcp.xml | 32 | ||||
-rw-r--r-- | lib/kernel/doc/src/inet.xml | 8 |
2 files changed, 30 insertions, 10 deletions
diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml index a7deb1562f..7f23c16f67 100644 --- a/lib/kernel/doc/src/gen_tcp.xml +++ b/lib/kernel/doc/src/gen_tcp.xml @@ -97,14 +97,30 @@ do_recv(Sock, Bs) -> message (<c>{tcp_closed, ...}</c> will be received (not an error). </p> </item> - <item><p>The option - <seeerl marker="inet#option-show_econnreset">show_econnreset</seeerl> - basically do <em>not</em> - work as described when used with <c>inet_backend = socket</c>. - The "issue" is that a remote close (as described above) - <em>do</em> allow a reader to extract what is in the read buffers - before a close is "delivered". - </p></item> + <item> + <p>The option + <seeerl marker="inet#option-show_econnreset">show_econnreset</seeerl> + basically do <em>not</em> + work as described when used with <c>inet_backend = socket</c>. + The "issue" is that a remote close (as described above) + <em>do</em> allow a reader to extract what is in the read buffers + before a close is "delivered".</p> + </item> + + <item> + <p>The option + <seeerl marker="inet#option-nodelay">nodelay</seeerl> + is a TCP specific option that is <em>not</em> compatible with + <c>domain = local</c>. </p> + <p>When using <c>inet_backend = socket</c>, trying to create a socket + (via listen or connect) with <c>domain = local</c> + (for example with option {ifaddr, {local,"/tmp/test"}}) + <em>will fail</em> with <c>{error, enotsup}</c>. </p> + <p>This does not actually work for <c>inet_backend = inet</c> either, + but in that case the error is simply <em>ignored</em>, + which is a <em>bad</em> idea. We have choosen to <em>not</em> + ignore this error for <c>inet_backend = socket</c>. </p> + </item> <item><p><seeerl marker="#async_shutdown_write">Async shutdown write</seeerl></p></item> </list> diff --git a/lib/kernel/doc/src/inet.xml b/lib/kernel/doc/src/inet.xml index 903f58a1c4..2bf7c1066e 100644 --- a/lib/kernel/doc/src/inet.xml +++ b/lib/kernel/doc/src/inet.xml @@ -1206,12 +1206,16 @@ setcap cap_sys_admin,cap_sys_ptrace,cap_dac_read_search+epi beam.smp</code> <tag><c>binary</c></tag> <item> <p>Received <c>Packet</c> is delivered as a binary.</p> + <marker id="option-nodelay"></marker> </item> <tag><c>{nodelay, Boolean}</c>(TCP/IP sockets)</tag> <item> <p>If <c>Boolean == true</c>, option <c>TCP_NODELAY</c> - is turned on for the socket, which means that also small - amounts of data are sent immediately.</p> + is turned on for the socket, which means that also small + amounts of data are sent immediately.</p> + <p>This option is <em>not</em> supported for + <c>domain = local</c>, but if <c>inet_backend =/= socket</c> + this error will be <em>ignored</em>. </p> </item> <tag><c>{nopush, Boolean}</c>(TCP/IP sockets)</tag> <item> |