Netty: ClosedChannelException when closing a channel

Why, when I try to close the channel, I received a ChannelClosedException? Closing with Channel.close (), exception stacktrace:

java.nio.channels.ClosedChannelException at org.jboss.netty.channel.socket.nio.NioWorker.cleanUpWriteBuffer(NioWorker.java:645) at org.jboss.netty.channel.socket.nio.NioWorker.close(NioWorker.java:601) at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:119) at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:76) at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:60) at org.jboss.netty.channel.Channels.close(Channels.java:720) at org.jboss.netty.channel.AbstractChannel.close(AbstractChannel.java:200) at ru.greencubes.player.PlayerWorkerThread.closeConnection(PlayerWorkerThread.java:107) at ru.greencubes.player.PlayerWorkerThread.shutDown(PlayerWorkerThread.java:282) at ru.greencubes.player.NetworkPlayerThread.disconnect(NetworkPlayerThread.java:1289) at ru.greencubes.player.NetworkPlayerThread.disconnect(NetworkPlayerThread.java:1272) at ru.greencubes.server.Server.run(Server.java:1590) at ru.greencubes.server.ServerThread.run(ServerThread.java:12) 
+3
source share
1 answer

I think you should just ignore it. He simply told you that the channel was already closed when he tried to write the remaining bytes to the channel. So there is nothing to worry about.

+3
source

Source: https://habr.com/ru/post/1392503/


All Articles