aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWojtek Mach <[email protected]>2019-02-09 17:40:49 +0100
committerWojtek Mach <[email protected]>2019-02-09 17:58:02 +0100
commitbd1551d88022195b93910ba682b59a34cffed0fa (patch)
treef32bb958bc5297319cd94082ccabf851825fd449
parent20b76b6c535bf0279950ea9ef5d02c52a9f8b51c (diff)
downloadotp-bd1551d88022195b93910ba682b59a34cffed0fa.tar.gz
otp-bd1551d88022195b93910ba682b59a34cffed0fa.tar.bz2
otp-bd1551d88022195b93910ba682b59a34cffed0fa.zip
gen_tcp: Update connect/3, accept/1, and recv/3 specs
* `connect/3` can return `{error, timeout}` * `accept/1` cannot return `{error, timeout}` * `recv/3` can return `{error, timeout}`
-rw-r--r--lib/kernel/src/gen_tcp.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/kernel/src/gen_tcp.erl b/lib/kernel/src/gen_tcp.erl
index 7f7833ec23..5d4764f8ff 100644
--- a/lib/kernel/src/gen_tcp.erl
+++ b/lib/kernel/src/gen_tcp.erl
@@ -156,7 +156,7 @@ connect(Address, Port, Opts) ->
Options :: [connect_option()],
Timeout :: timeout(),
Socket :: socket(),
- Reason :: inet:posix().
+ Reason :: timeout | inet:posix().
connect(Address, Port, Opts, Time) ->
Timer = inet:start_timer(Time),
@@ -220,7 +220,7 @@ listen(Port, Opts0) ->
-spec accept(ListenSocket) -> {ok, Socket} | {error, Reason} when
ListenSocket :: socket(),
Socket :: socket(),
- Reason :: closed | timeout | system_limit | inet:posix().
+ Reason :: closed | system_limit | inet:posix().
accept(S) ->
case inet_db:lookup_socket(S) of
@@ -312,7 +312,7 @@ recv(S, Length) when is_port(S) ->
Length :: non_neg_integer(),
Timeout :: timeout(),
Packet :: string() | binary() | HttpPacket,
- Reason :: closed | inet:posix(),
+ Reason :: closed | timeout | inet:posix(),
HttpPacket :: term().
recv(S, Length, Time) when is_port(S) ->