diff options
author | Micael Karlberg <bmk@erlang.org> | 2021-02-26 14:47:37 +0100 |
---|---|---|
committer | Micael Karlberg <bmk@erlang.org> | 2021-02-26 14:47:37 +0100 |
commit | b2709d2269ef59668b18bec28a94195f8463b8b3 (patch) | |
tree | 0e37bdb5e3545c91d02ac2954cbc1f64e99cf891 | |
parent | 07e73c479cb0a5bf83509d6c7859773adcb45b56 (diff) | |
download | erlang-b2709d2269ef59668b18bec28a94195f8463b8b3.tar.gz |
[kernel|gen-tcp-socket|doc] Improve note about non-blocking send
OTP-17156
-rw-r--r-- | lib/kernel/doc/src/gen_tcp.xml | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml index 7f23c16f67..9f8b1baa55 100644 --- a/lib/kernel/doc/src/gen_tcp.xml +++ b/lib/kernel/doc/src/gen_tcp.xml @@ -70,7 +70,20 @@ do_recv(Sock, Bs) -> Here is a list of cases when the behaviour of inet-backend <c>inet</c> (default) and <c>socket</c> are different: </p> <list type="bulleted"> - <item><p><seeerl marker="#non_blocking_send">Non-blocking send</seeerl></p></item> + <item> + <p><seeerl marker="#non_blocking_send">Non-blocking send</seeerl></p> + <p>If a user calling + <seemfa marker="#send/2"><c>gen_tcp:send/2</c></seemfa> + with <c>inet_backend = inet</c>, + tries to send more data than there is room for in the OS buffers, + the "rest data" is buffered by the inet driver (and later sent in the + background). + The effect for the user is that the call is non-blocking.</p> + <p>This is <em>not</em> the effect when + <c>inet_backend = socket</c>, since there is no buffering. + Instead the user hangs either until all data has been sent or the + <c>send_timeout</c> timeout has been reached. </p> + </item> <item><p>Remote close detected by background send. </p> <p>An background send will detect a 'remote close' and |