Fixed a bug where channelClosed event is not propagated in ReadTimeoutHandler

This commit is contained in:
Trustin Lee 2009-02-07 12:48:14 +00:00
parent 63e586586b
commit 188c7f94aa

View File

@ -90,21 +90,21 @@ public class ReadTimeoutHandler extends SimpleChannelUpstreamHandler implements
public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e) public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
throws Exception { throws Exception {
initialize(ctx); initialize(ctx);
super.channelOpen(ctx, e); ctx.sendUpstream(e);
} }
@Override @Override
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
throws Exception { throws Exception {
destroy(); destroy();
super.channelOpen(ctx, e); ctx.sendUpstream(e);
} }
@Override @Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
throws Exception { throws Exception {
lastReadTime = System.nanoTime(); lastReadTime = System.nanoTime();
super.messageReceived(ctx, e); ctx.sendUpstream(e);
} }
private void initialize(ChannelHandlerContext ctx) { private void initialize(ChannelHandlerContext ctx) {