diff options
author | Péter Gömöri <[email protected]> | 2016-10-20 01:05:45 +0200 |
---|---|---|
committer | Péter Gömöri <[email protected]> | 2016-10-27 22:15:12 +0200 |
commit | 70526ab4e8b5a0d84c5cfd27557a481707420ce2 (patch) | |
tree | d6109885224a53f7400defddbbd5f39385adf0fc /lib/kernel/doc/src/gen_tcp.xml | |
parent | 9be10412e1837aac339a284f2b01cfc112778180 (diff) | |
download | otp-70526ab4e8b5a0d84c5cfd27557a481707420ce2.tar.gz otp-70526ab4e8b5a0d84c5cfd27557a481707420ce2.tar.bz2 otp-70526ab4e8b5a0d84c5cfd27557a481707420ce2.zip |
controlling_process can return {error, badarg}
For gen_tcp, gen_udp and gen_sctp controlling_process/2 can return
badarg if erlang:port_connect/2 fails with badarg. This can easily
happen if the new owner is not alive but in some race condition also
when the socket is closed right before port_connect/2 (and after the
previous socket function)
This commit documents this behaviour.
Diffstat (limited to 'lib/kernel/doc/src/gen_tcp.xml')
-rw-r--r-- | lib/kernel/doc/src/gen_tcp.xml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml index 08454b9832..e97db20062 100644 --- a/lib/kernel/doc/src/gen_tcp.xml +++ b/lib/kernel/doc/src/gen_tcp.xml @@ -231,7 +231,11 @@ do_recv(Sock, Bs) -> <c><anno>Socket</anno></c>. The controlling process is the process that receives messages from the socket. If called by any other process than the current controlling process, - <c>{error, not_owner}</c> is returned.</p> + <c>{error, not_owner}</c> is returned. If the process identified + by <c><anno>Pid</anno></c> is not an existing local pid, + <c>{error, badarg}</c> is returned. <c>{error, badarg}</c> may also + be returned in some cases when <c><anno>Socket</anno></c> is closed + during the execution of this function.</p> <p>If the socket is set in active mode, this function will transfer any messages in the mailbox of the caller to the new controlling process. |