-3
inStream = new ObjectInputStream(this.socket.getInputStream());
Packet rank = (Packet)inStream.readObject();
嗨, 我應該從兩個客戶端接收數組。我只能從客戶端接收並提示這樣的錯誤:在此先感謝java socket ObjectInputStream
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2338)
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2351)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2822)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:804)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:301)
at ServerGraph$Handler.run(ServerGraph.java:350)
最有可能的發送方寫的對象,但沒」關閉()或甚至刷新()連接。 –