[erlang-questions] Finding closed socket

Matthias Lang <>
Tue Oct 17 08:26:59 CEST 2006


Surindar Sivanesan writes:
 > Hi
 > Server and client are communicating.
 > Then i disabled the network at client PC. The client application returns
 > {error,econnreset}.
 > Nothing is triggered at server side.
 > Then i send a message from server to client but the gen_tcp:send result is
 > returned as 'ok' instead of '{error,Reason}'.

ok is the correct result. 

Christian's protocol allows you to detect a lack of network
connectivity within a time of your choosing, i.e. the timeout you
choose for receiving the pong.

Your implementation of fairly exactly half of what Christian suggested
doesn't solve the problem you're attempting to solve.

Matthias



More information about the erlang-questions mailing list