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

前端 未结 2 796
花落未央
花落未央 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.

提交回复
热议问题