Unexplained Timeouts (Netty 3.2.4.Final)
이희승 (Trustin Lee)
trustin at gmail.com
Thu Aug 11 23:35:24 EDT 2011
Hi,
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.
HTH
--
Trustin Lee (http://gleamynode.net/)
On Friday, August 5, 2011 at 8:18 PM, B.L. Zeebub wrote:
> Hi
>
> I've got a Netty Client & Server which are configured for stayawake. The
> client is built as
>
> bootstrap.setPipelineFactory(new
> ClientPipelineFactory(executor,timer,listener));
> bootstrap.setOption("keepAlive", true);
>
> // Make a new connection.
> ChannelFuture future = bootstrap.connect(new InetSocketAddress(
> host, 5956));
>
> and the server us built with;
>
> bootstrap.setPipelineFactory(new
> ServerPipelineFactory(connectionManager));
> bootstrap.setOption("child.tcpNoDelay", true);
> bootstrap.setOption("child.keepAlive", true);
>
>
> When I have both client & server running on localhost on a Windows box, the
> connection remains open indefinitely.
>
> However, I've now moved the server to a remote server running CentOS 5. Now,
> the server side connection closes after approximately 20 minutes of
> inactivity. However, the Netty Server doesn't seem to notice until it tries
> to send something to the client after the closure event happens.
>
> When the Netty server trys to send, I see an IOException Connection Reset by
> Peer message and then the ChannelDisconnected event is fired. Even when this
> happens the client does not receive any notification that the channel has
> closed.
>
> Two questions.
>
> I'm assuming that the socket closure is being done by CentOS rather than
> Netty? If so, does anyone with Centos (or general Linux) experience have any
> idea what I should be looking for to find out why the socket is being
> closed?
>
> Secondly, why doesn't the client pickup on the fact that the server has
> closed the channel - either at the point that the socket is actually closed
> or at the point that the server notices? Do I need to do anything in the
> server-side ChannelDisconnected event (at the moment I'm simply logging the
> fact that it has been fired)?
>
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Unexplained-Timeouts-Netty-3-2-4-Final-tp6656144p6656144.html
> Sent from the Netty User Group mailing list archive at Nabble.com (http://Nabble.com).
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org (mailto:netty-users at lists.jboss.org)
> https://lists.jboss.org/mailman/listinfo/netty-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20110812/f91e97b7/attachment.html
More information about the netty-users
mailing list