Read and WriteTimeoutHandlers stopped working
sifman
watsis at hotmail.com
Mon Jan 10 05:54:44 EST 2011
Does anyone know under what circumstances is it possible for configured Read
and WriteTimeoutHandlers to stop working?
This worked fine in the past and nothing changed: not the src code or Netty
version (3.1.5).
Code as follows:
pipeline.addLast("readTimeout", new ReadTimeoutHandler(timer, 0,
TimeUnit.MINUTES));
pipeline.addLast("writeTimeout", new WriteTimeoutHandler(timer, 30,
TimeUnit.SECONDS));
This used to throw the WriteTimeoutException, but not anymore for no
apparent reason.
To bypass this I've managed to get a timeout again by using the
IdleStateHandler as follows:
pipeline.addLast("idleStateHandler", new IdleStateHandler(timer, 0, 30, 0,
TimeUnit.SECONDS));
With this in my handler class as well:
@Override
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e)
throws Exception {
if (e instanceof IdleStateEvent) {
//do custom code
}
super.handleUpstream(ctx, e);
}
I find this very weird, that is that IdleStateHandler works but not the
WriteTimeoutHandler anymore. Has anyone ever seen/experienced something
similar?
Any input is appreciated.
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Read-and-WriteTimeoutHandlers-stopped-working-tp5906501p5906501.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list