我正在使用将打开ServerSocketChannel并绑定客户端端口的NIO线程。但是当我们尝试从Socket chanel读取数据时,显示了下面提到的异常。如果有人提供解决方案,那就太好了。
Connection reset by peer java.net.SocketException: Transport endpoint is not connected
at sun.nio.ch.SocketChannelImpl.shutdown(Native Method)
at sun.nio.ch.SocketChannelImpl.shutdownOutput(SocketChannelImpl.java:669)
at sun.nio.ch.SocketAdaptor.shutdownOutput(SocketAdaptor.java:386)
at iyp.trncomms.ConnRecordWriter.checkShutDown(ConnRecordWriter.java:131)
at iyp.trncomms.ConnRecordWriter.continueWriting(ConnRecordWriter.java:214)
at iyp.trncomms.ConnRecordWriter.retry(ConnRecordWriter.java:101)
at iyp.trncomms.ConnRecordWriter.shutDown(ConnRecordWriter.java:92)
at iyp.trncomms.ConnRecord$WorkingState.toOnHoldState(ConnRecord.java:1224)
at iyp.trncomms.ConnRecord$WorkingState.onInputError(ConnRecord.java:1152)
at iyp.trncomms.ConnRecord.read(ConnRecord.java:124)
at iyp.trncomms.NIO.run(NIO.java:137)