0
我們一直在使用netty-handler 4.0.28.Final。我們有一個測試,我們將無效的xml寫入測試通道。如下所示,ctx.close()將被調用,channelInactive會觸發。當我在ChannelHandlerContext上調用close()時channelInactive()沒有被調用
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable exc) {
if (connectionListener == null) {
return;
}
// Treat unexpected exceptions as fatal to the connection
try {
connectionListener.connectionError(exc);
} finally {
ctx.close();
}
}
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
if (connectionListener == null) {
return;
}
connectionListener.connectionClosed();
}
我的任務是將netty更新爲netty-all 4.1.11.Final。自更新以來,channelInactive沒有被調用。 (只有在我們在整理期間調用EmbeddedChannel上的finish()時才被調用)。
當我們調用ctx.close()時,爲什麼channelInactive不再被調用?
能否請您在nettys的bug跟蹤器打開一個bug,代碼複製它。 –
@NormanMaurer,謝謝 - 我創建了以下問題https://github.com/netty/netty/issues/6894 – Paulie22