How to set connection timeout
jsia24
jsia18 at gmail.com
Tue May 17 21:23:52 EDT 2011
Hi,
I am using the http snoop example and making a comet server out of it, so
the client requests and its a long running request, when there is a response
from the server then it writes data to the connection and closes it.
However, if the connection is idle for a particular length of time I would
like to close it. How can this be done in netty. I've seen
Timer timer = new HashedWheelTimer();
pipeline.addLast('timeout', new IdleStateHandler(timer, 30, 30, 0));
pipeline.addLast('handler', new MyHandler());
but in the http snoop example it already has
pipeline.addLast('handler', new HttpRequestHandler());
so it produces an error coz I assigned 2 handlers for the parameter handler
Is there a simpler way of doing this?
Thanks,
Jason
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/How-to-set-connection-timeout-tp6375992p6375992.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list