diff options
author | Zandra Hird <[email protected]> | 2015-06-02 15:40:58 +0200 |
---|---|---|
committer | Zandra Hird <[email protected]> | 2015-06-02 15:40:58 +0200 |
commit | b4774c9d55a1606a1abc726e0f7ce563065284b3 (patch) | |
tree | 8f6a8834dc96f5e47cab64da9337efbb90f076f1 /lib/kernel/doc | |
parent | 65bf43e82a8ec731aafdbac74d41d65b63c7f49c (diff) | |
parent | 25bd6312491fc9153a16f74b5d1d39609426ae60 (diff) | |
download | otp-b4774c9d55a1606a1abc726e0f7ce563065284b3.tar.gz otp-b4774c9d55a1606a1abc726e0f7ce563065284b3.tar.bz2 otp-b4774c9d55a1606a1abc726e0f7ce563065284b3.zip |
Merge branch 'nybek/fix_gen_tcp_shutdown'
OTP-12797
Diffstat (limited to 'lib/kernel/doc')
-rw-r--r-- | lib/kernel/doc/src/gen_tcp.xml | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml index 820ecd1e30..71ef5cd48f 100644 --- a/lib/kernel/doc/src/gen_tcp.xml +++ b/lib/kernel/doc/src/gen_tcp.xml @@ -347,11 +347,22 @@ do_recv(Sock, Bs) -> </func> <func> <name name="shutdown" arity="2"/> - <fsummary>Immediately close a socket</fsummary> + <fsummary>Asynchronously close a socket</fsummary> <desc> - <p>Immediately close a socket in one or two directions.</p> + <p>Close a socket in one or two directions.</p> <p><c><anno>How</anno> == write</c> means closing the socket for writing, reading from it is still possible.</p> + <p>If <c><anno>How</anno> == read</c>, or there is no outgoing + data buffered in the <c><anno>Socket</anno></c> port, + then the socket is shutdown immediately and any error encountered + is returned in <c><anno>Reason</anno></c>.</p> + <p>If there is data buffered in the socket port, then the attempt + to shutdown the socket is postponed until that data is written to the + kernel socket send buffer. Any errors encountered will result + in the socket being closed and <c>{error, closed}</c> being returned + on the next + <seealso marker="gen_tcp#recv/2">recv/2</seealso> or + <seealso marker="gen_tcp#send/2">send/2</seealso>.</p> <p>To be able to handle that the peer has done a shutdown on the write side, the <c>{exit_on_close, false}</c> option is useful.</p> |