From 2b5b0eb0115f59f652c3e882b3f5e48920b8bd24 Mon Sep 17 00:00:00 2001 From: Brujo Benavides Date: Fri, 22 Mar 2019 07:21:43 -0300 Subject: Add a note about timeouts on gen_tcp:connect/3,4 Taken almost verbatim from @RaimoNiskanen's comment from [10 years ago](http://erlang.2086793.n4.nabble.com/strange-behaviour-of-gen-tcp-connect-tp2113918p2113920.html). --- lib/kernel/doc/src/gen_tcp.xml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/kernel/doc') diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml index fc16473393..751dfcad1d 100644 --- a/lib/kernel/doc/src/gen_tcp.xml +++ b/lib/kernel/doc/src/gen_tcp.xml @@ -258,6 +258,12 @@ do_recv(Sock, Bs) -> {tcp_error, Socket, Reason}

The optional Timeout parameter specifies a time-out in milliseconds. Defaults to infinity.

+ +

Keep in mind that if the underlying OS connect() call returns + with a timeout, gen_tcp:connect will also return with a timeout + (i.e. {error, etimedout}), even if a larger Timeout was + specified.

+

The default values for options specified to connect can be affected by the Kernel configuration parameter -- cgit v1.2.3