java NIO异常问题

java NIO运行时异常
服务器已开启,端口号12345

java.nio.channels.NotYetConnectedException at sun.nio.ch.SocketChannelImpl.ensureWriteOpenUnknown Source at sun.nio.ch.SocketChannelImpl.writeUnknown Source at com.java.io.NIO.ClientHandle.doWriteClientHandle.java:130 at com.java.io.NIO.ClientHandle.sendMsgClientHandle.java:139 at com.java.io.NIO.Client.sendMsgClient.java:25 at com.java.io.NIO.Test.mainTest.java:10
java.lang.IllegalArgumentException at java.nio.channels.spi.AbstractSelectableChannel.registerUnknown Source at java.nio.channels.SelectableChannel.registerUnknown Source at com.java.io.NIO.ClientHandle.doConnectClientHandle.java:134 at com.java.io.NIO.ClientHandle.runClientHandle.java:46 at java.lang.Thread.runUnknown Source

贴出代码,看exception很难猜出来是什么原因

发表评论

电子邮件地址不会被公开。 必填项已用*标注