test server and client on windows and ubuntu 10.10
I use 1 computer running Windows 7 system and 1 computer running Ubuntu 10.10 system to test my assignment written in Java for networking class, something happened like below.
- Run both Client and Server on the Window 7 system computer: works fine
- Run both Client and Server on the Ubuntu 10.10 system computer: works fine
- Run Client on Window 7 system computer and Server on Ubuntu 10.10 system computer: works fine
Run Client on Ubuntu 10.10 system computer and Server on Window 7 system computer:
- Server: works fine
- Client: run until the last code line where it needs to receive a simple text from Server. The error is below:
Exception in thread "main" java.net.SocketException: Connection reset at java.net.SocketInputStream.r开发者_Python百科ead(SocketInputStream.java:185) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176) at java.io.InputStreamReader.read(InputStreamReader.java:184) at java.io.BufferedReader.fill(BufferedReader.java:153) at java.io.BufferedReader.readLine(BufferedReader.java:316) at java.io.BufferedReader.readLine(BufferedReader.java:379) at Client.main(Client.java:59)
Why?
精彩评论