diff options
Diffstat (limited to 'lib/kernel')
-rw-r--r-- | lib/kernel/doc/src/gen_tcp.xml | 8 | ||||
-rw-r--r-- | lib/kernel/test/gen_tcp_api_SUITE.erl | 4 | ||||
-rw-r--r-- | lib/kernel/test/heart_SUITE.erl | 7 |
3 files changed, 15 insertions, 4 deletions
diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml index 88135ea43d..83242c2df8 100644 --- a/lib/kernel/doc/src/gen_tcp.xml +++ b/lib/kernel/doc/src/gen_tcp.xml @@ -232,6 +232,14 @@ do_recv(Sock, Bs) -> 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> + <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. + If any other process is interacting with the socket while + the transfer is happening, the transfer may not work correctly + and messages may remain in the caller's mailbox. For instance + changing the sockets active mode before the transfere is complete + may cause this.</p> </desc> </func> diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl index 6f6f53309e..54298e6309 100644 --- a/lib/kernel/test/gen_tcp_api_SUITE.erl +++ b/lib/kernel/test/gen_tcp_api_SUITE.erl @@ -135,8 +135,8 @@ t_recv_delim(Config) when is_list(Config) -> {ok, Client} = gen_tcp:connect(localhost, Port, Opts), {ok, A} = gen_tcp:accept(L), ok = gen_tcp:send(A, "abcXefgX"), - {ok, "abcX"} = gen_tcp:recv(Client, 0, 0), - {ok, "efgX"} = gen_tcp:recv(Client, 0, 0), + {ok, "abcX"} = gen_tcp:recv(Client, 0, 200), + {ok, "efgX"} = gen_tcp:recv(Client, 0, 200), ok = gen_tcp:close(Client), ok = gen_tcp:close(A), ok. diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl index e63ed34973..45032faf6d 100644 --- a/lib/kernel/test/heart_SUITE.erl +++ b/lib/kernel/test/heart_SUITE.erl @@ -74,7 +74,8 @@ all() -> [ set_cmd, clear_cmd, get_cmd, callback_api, options_api, - kill_pid + kill_pid, + heart_no_kill ]. groups() -> @@ -634,7 +635,9 @@ suicide_by_heart() -> end. non_suicide_by_heart() -> - P = open_port({spawn,"heart -ht 11 -pid "++os:getpid()},[exit_status, {env, {"HEART_NO_KILL", "TRUE"}}, {packet,2}]), + P = open_port({spawn,"heart -ht 11 -pid "++os:getpid()}, + [exit_status, {env, [{"HEART_NO_KILL", "TRUE"}]}, + {packet,2}]), receive X -> X end, %% Just hang and wait for heart to timeout receive |