How to set connection timeout

jsia24 jsia18 at gmail.com
Wed May 18 06:24:35 EDT 2011


ok ill give it a try thanks

On Wed, May 18, 2011 at 4:27 PM, christian [via Netty Forums and Mailing
Lists] <ml-node+6376719-1179619532-301197 at n2.nabble.com> wrote:

> Hi,
>
> try
>
> Timer timer = new HashedWheelTimer();
> pipeline.addLast('timeout', new IdleStateHandler(timer, 30, 30, 0));
> pipeline.addLast("ohmygod-thisisjustastringkey-icansetwhateveriwanthere",
> new MyHandler());
>
> regards,
> christian
>
>
> On Wed, May 18, 2011 at 3:23 AM, jsia24 <[hidden email]<http://user/SendEmail.jtp?type=node&node=6376719&i=0>>
> wrote:
>
> > 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.
> > _______________________________________________
> > netty-users mailing list
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=6376719&i=1>
> > https://lists.jboss.org/mailman/listinfo/netty-users
> >
>
> _______________________________________________
> netty-users mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=6376719&i=2>
> https://lists.jboss.org/mailman/listinfo/netty-users
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://netty-forums-and-mailing-lists.685743.n2.nabble.com/How-to-set-connection-timeout-tp6375992p6376719.html
>  To unsubscribe from How to set connection timeout, click here<http://netty-forums-and-mailing-lists.685743.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=6375992&code=anNpYTE4QGdtYWlsLmNvbXw2Mzc1OTkyfDE0MTk5NTMxMjM=>.
>
>


--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/How-to-set-connection-timeout-tp6375992p6377214.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list