[erlang-questions] {error,closed} vs. {error,econnreset}

Rory Byrne rory@REDACTED
Wed Jun 24 14:48:17 CEST 2015


Hi Andras,

On Tue, May 05, 2015 at 07:44:47AM +0000, Bekes, Andras G wrote:
> Thank you very much for your efforts Rory.
> 
> The ability "to set a socket option that shows all econnreset errors" sounds like the right solution. I am wondering why hiding this detail is the default, but I believe there were good enough reasons to design it that way.
> 
> I accept that your solution will not notice the connection reset event in some corner cases. I think this will not apply in my case: I am sending a small amount of data (<1KB) and wait for the reply.
> 
> I am looking forward to see your patch in the next release of Erlang/OTP!

The fix for this is in the 18.0 release. It should take care of the
corner cases too.

Use the socket option '{show_econnreset, true}' and you'll receive
{error, econnreset} in passive mode or {tcp_error, Socket, econnreset}
in active mode. See the docs [1] for more information.

Regards,

Rory

[1] http://www.erlang.org/doc/man/inet.html#setopts-2



More information about the erlang-questions mailing list