Netty サーバーは、ChannelHandler の exceptionCaught メソッドからクライアントにエラー応答を返します。クライアントが消失した場合、これにより無限再帰が発生します。スタック トレースのスニペットは次のとおりです。
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:778) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromUserCode(AbstractNioWorker.java:501) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:129) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:66) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.Channels.write(Channels.java:733) [netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.Channels.write(Channels.java:694) [netty-3.5.7.Final.jar:na]
at com.inversoft.cleanspeak.store.content.server.netty.ContentStoreChannelHandler.exceptionCaught(ContentStoreChannelHandler.java:68) ~[cleanspeak-content-store-2.3.jar:2.3]
at org.jboss.netty.handler.codec.frame.FrameDecoder.exceptionCaught(FrameDecoder.java:378) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:533) [netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:790) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromUserCode(AbstractNioWorker.java:501) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:129) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:66) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.Channels.write(Channels.java:733) [netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.Channels.write(Channels.java:694) [netty-3.5.7.Final.jar:na]
at com.inversoft.cleanspeak.store.content.server.netty.ContentStoreChannelHandler.exceptionCaught(ContentStoreChannelHandler.java:68) ~[cleanspeak-content-store-2.3.jar:2.3]
at org.jboss.netty.handler.codec.frame.FrameDecoder.exceptionCaught(FrameDecoder.java:378) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:533) [netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.cleanUpWriteBuffer(AbstractNioWorker.java:790) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromUserCode(AbstractNioWorker.java:501) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:129) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:66) ~[netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.Channels.write(Channels.java:733) [netty-3.5.7.Final.jar:na]
at org.jboss.netty.channel.Channels.write(Channels.java:694) [netty-3.5.7.Final.jar:na]
私の質問は、私の exceptionCaught メソッドにクライアントがまだ存在するかどうかをテストするための最良の方法は何ですか? e.getChannel().isOpen() は機能しますか?