Fixed a bug where channelClosed event is not propagated in ReadTimeoutHandler
This commit is contained in:
parent
63e586586b
commit
188c7f94aa
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user