gpt4 book ai didi

java - Netty:关闭 channel 时出现 ClosedChannelException

转载 作者:塔克拉玛干 更新时间:2023-11-02 18:59:28 27 4
gpt4 key购买 nike

为什么当我尝试关闭 channel 时,抛出了 ChannelClosedException?使用 Channel.close() 关闭,异常的堆栈跟踪:

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)

最佳答案

我认为你应该忽略它。它只是告诉你,当它试图将剩余的字节写入 channel 时, channel 已经关闭。所以不用担心。

关于java - Netty:关闭 channel 时出现 ClosedChannelException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8872106/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com