<div>Hi,<div><br></div><div>I don't think Netty closes the connection in this case. I suspect the O/S or network configuration. No matter what the cause is, such exception can always happen and there's always a chance where a peer is not notified on disconnection. Therefore, it's wise to send some periodical ping/pong message to the connection to see the connection is really alive.</div><div><br></div><div>HTH</div></div>
<div><br>-- <br><a href="http://gleamynode.net/">Trustin Lee</a><br></div>
<p style="color: #A0A0A8;">On Friday, August 5, 2011 at 8:18 PM, B.L. Zeebub wrote:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div>Hi<br><br>I've got a Netty Client & Server which are configured for stayawake. The<br>client is built as<br><br>bootstrap.setPipelineFactory(new<br>ClientPipelineFactory(executor,timer,listener));<br>                bootstrap.setOption("keepAlive", true);<br>                <br>                // Make a new connection.<br>                ChannelFuture future = bootstrap.connect(new InetSocketAddress(<br>                                host, 5956));<br><br>and the server us built with;<br><br>                 bootstrap.setPipelineFactory(new<br>ServerPipelineFactory(connectionManager));<br>                 bootstrap.setOption("child.tcpNoDelay", true);<br>                 bootstrap.setOption("child.keepAlive", true); <br>                 <br><br>When I have both client & server running on localhost on a Windows box, the<br>connection remains open indefinitely.<br><br>However, I've now moved the server to a remote server running CentOS 5. Now,<br>the server side connection closes after approximately 20 minutes of<br>inactivity. However, the Netty Server doesn't seem to notice until it tries<br>to send something to the client after the closure event happens.<br><br>When the Netty server trys to send, I see an IOException Connection Reset by<br>Peer message and then the ChannelDisconnected event is fired. Even when this<br>happens the client does not receive any notification that the channel has<br>closed.<br><br>Two questions.<br><br>I'm assuming that the socket closure is being done by CentOS rather than<br>Netty? If so, does anyone with Centos (or general Linux) experience have any<br>idea what I should be looking for to find out why the socket is being<br>closed?<br><br>Secondly, why doesn't the client pickup on the fact that the server has<br>closed the channel - either at the point that the socket is actually closed<br>or at the point that the server notices? Do I need to do anything in the<br>server-side ChannelDisconnected event (at the moment I'm simply logging the<br>fact that it has been fired)?<br><br>--<br>View this message in context: <a href="http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Unexplained-Timeouts-Netty-3-2-4-Final-tp6656144p6656144.html">http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Unexplained-Timeouts-Netty-3-2-4-Final-tp6656144p6656144.html</a><br>Sent from the Netty User Group mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>_______________________________________________<br>netty-users mailing list<br><a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/netty-users">https://lists.jboss.org/mailman/listinfo/netty-users</a><br></div></div></span>
</blockquote>
<div>
<br>
</div>