aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/doc/src/gen_tcp.xml8
-rw-r--r--lib/kernel/test/gen_tcp_api_SUITE.erl4
2 files changed, 10 insertions, 2 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.