Skip to content

Commit

Permalink
Use send_timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
lpgauth committed Nov 19, 2013
1 parent 88e0e64 commit 8fdce34
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ranch_tcp.erl
Expand Up @@ -86,6 +86,10 @@ listen(Opts) ->
-> {ok, inet:socket()} | {error, closed | timeout | atom()}.
accept(LSocket, Timeout) ->
statsderl:increment([<<"connections.accept">>], 1, 0.01),
inet:setopts(LSocket, [
{send_timeout, 5000},
{send_timeout_close, true}
]),
gen_tcp:accept(LSocket, Timeout).

%% @private Experimental. Open a connection to the given host and port number.
Expand Down

0 comments on commit 8fdce34

Please sign in to comment.