我有时会遇到错误。错误堆栈跟踪如下;
2011-05-04-xWorkerPool-1-thread-2--FATAL-su.games.engine.communication.gameSocketDataHandler:ServiceSocketDataHandler.onData:
could not write. channel is close or not initialized (id=25c1031512fb560155a71db6548S1517c (closed))-----
org.xsocket.connection.ExtendedClosedChannelException: could not write. channel is close or not initialized (id=25c1031512fb560155a71db6548S1517c (closed))
at org.xsocket.connection.AbstractNonBlockingStream.ensureStreamIsOpenAndWritable(AbstractNonBlockingStream.java:1537)
at org.xsocket.connection.AbstractNonBlockingStream.write(AbstractNonBlockingStream.java:1054)
at org.xsocket.connection.AbstractNonBlockingStream.write(AbstractNonBlockingStream.java:1039)
at su.games.engine.communication.ServiceSocketDataHandler.onData(ServiceSocketDataHandler.java:63)
at org.xsocket.connection.HandlerAdapter.performOnData(HandlerAdapter.java:242)
at org.xsocket.connection.HandlerAdapter.access$200(HandlerAdapter.java:42)
at org.xsocket.connection.HandlerAdapter$PerformOnDataTask.run(HandlerAdapter.java:210)
at org.xsocket.SerializedTaskQueue.performPendingTasks(SerializedTaskQueue.java:161)
at org.xsocket.SerializedTaskQueue.access$100(SerializedTaskQueue.java:40)
at org.xsocket.SerializedTaskQueue$MultithreadedTaskProcessor.run(SerializedTaskQueue.java:189)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
我使用xSocket 2.8.15版本(jar)。很抱歉我有权限问题来创建新标记。错误可以定义如下。我有一些INonBlockingConnection对象,当我尝试使用nbc.write()编写一些数据时,我得到一个如上定义的错误。我搜索谷歌并访问xSocket邮件列表。但我找不到任何解决方案。我需要一些帮助。感谢网站StackOverflow并帮助对不起英语。我在等你的建议。
KingSpeech。
答案 0 :(得分:0)
错误显得相当自我解释。您的连接似乎已关闭或无法连接。这很可能是由于另一方(或您的网络)存在问题