<div><br><font face="georgia">Hi</font></div>
<div><font face="georgia">Server and client are communicating.</font></div>
<div><font face="georgia">Then i disabled the network at client PC. The client application returns {error,econnreset}.</font></div>
<div><font face="georgia">Nothing is triggered at server side. </font></div>
<div><font face="georgia">Then i send a message from server to client but the gen_tcp:send result is returned as 'ok' instead of '{error,Reason}'.</font><br> </div>
<div><span class="gmail_quote">On 10/16/06, <b class="gmail_sendername">Christian S</b> <<a href="mailto:chsu79@gmail.com">chsu79@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">This is a common problem and the solution is a bit of a "pattern":<br><br>Use ping messages in your protocol to see that the other end is still
<br>there. I.e. modify your protocol so it has a "noop" ping-pong<br>request-reply.<br><br>TCP keepalives are almost unusable since the interval between<br>keepalives is often unusably long, and OS implementations of tcp
<br>stacks do typically not allow you to change this on a per-socket<br>level, instead it is OS-global.<br><br>PS. Come to think of it. Is this still true and why do we accept it?<br>Gosh BSD-socket interface is lame. I want keepalives sent to my socket
<br>controller process!<br><br>On 10/16/06, Surindar Sivanesan <<a href="mailto:surindar.shanthi@gmail.com">surindar.shanthi@gmail.com</a>> wrote:<br>> Dear all,<br>><br>> I have client server application.<br>
> If network cable is unplugged at the client PC, the server is not able to<br>> detect the communication breakage.<br>> I have given<br>> gen_tcp:listen(Port,[{active,false},{packet,0},{keepalive,true}])<br>> in the server.
<br>> If any option is available to detect it at the server end, it will be very<br>> useful to me.<br>> Thanks in advance!<br>> --<br>> with regards,<br>> S.Surindar<br>> _______________________________________________
<br>> erlang-questions mailing list<br>> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>> <a href="http://www.erlang.org/mailman/listinfo/erlang-questions">http://www.erlang.org/mailman/listinfo/erlang-questions
</a><br>><br>><br>><br></blockquote></div><br><br clear="all"><br>-- <br>with regards,<br>S.Surindar