[erlang-questions] inet:peername behaviour

Sergei Fomin <>
Thu May 17 17:23:01 CEST 2012


I've come to the same problem as described in "Peername of a closed TCP 

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