Exception java.nio.channels.ClosedChannelException when write to client channel

前端 未结 2 797
花落未央
花落未央 2021-01-05 09:58

I have created a game server using netty 3.5.8. At first, there is not any problem with sending data from server to client. But when server operates for a while, there are m

相关标签:
2条回答
  • 2021-01-05 10:26

    ClosedChannelException merely tells you that the connection has been closed, so, the write request you issued could not be done. It usually means either:

    (1) your application closed the connection somewhere else before you write the message or
    (2) your peer closed the connection before reading your message.

    If you fix (1) and (2), you should not see the ClosedChannelException anymore.

    0 讨论(0)
  • 2021-01-05 10:28

    ClosedChannelException means you have closed the channel and continued to use it. It is a programming error on your part.

    0 讨论(0)
提交回复
热议问题