[erlang-questions] inet:peername behaviour

Sergei Fomin dafgar@REDACTED
Thu May 17 17:23:01 CEST 2012


Hello.

I've come to the same problem as described in "Peername of a closed TCP 
socket" 
(http://erlang.2086793.n4.nabble.com/Peername-of-a-closed-TCP-socket-td2114838.html).

There is a gen_tcp socket which I need some statistics from. Therefore 
exit_on_close socket option is turned off.

When the other end closes connection the right way, both inet:getstat 
and inet:peername return usable information.
But in case RST is received, inet:getstat still shows statistics while 
inet:peername produces {error,enotconn}. That seems not quite logical to me.

-- 
Sergei Fomin




More information about the erlang-questions mailing list