1

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.

  1. Run both Client and Server on the Window 7 system computer: works fine
  2. Run both Client and Server on the Ubuntu 10.10 system computer: works fine
  3. Run Client on Window 7 system computer and Server on Ubuntu 10.10 system computer: works fine
  4. 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.read(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?

Dead Programmer
  • 12,427
  • 23
  • 80
  • 112
John
  • 3,888
  • 11
  • 46
  • 84
  • Seems to be some firewall magic. Have you checked the windows firewall? Edit: You can do this by using nmap from the ubuntu machine and scan your win7 machine. – kasten Feb 12 '11 at 07:53
  • @kasten: nice suggestion. Here is the thing. I live in Uni dorm where there is proxy setting. I have 1 internet cable. I use connectify software to make Windows 7 computer system to be a Wireless Access Point so that Ubuntu 10.10 computer system can also connect to internet through wireless. I dont know if these settings effect my experiment. – John Feb 12 '11 at 07:57
  • I don't know connectify. But the fact that your win7 machine can connect to your ubuntu but not the other way around suggests a firewall issue. This can be caused by something not in under your controll like connectify or the local network. But shutting down the win7 firewall and scanning from the ubuntumachine migth give you a better idea what is going wrong. The Exception suggestes that the problem has nothing to do with your programm. – kasten Feb 12 '11 at 08:05
  • @kasten:I think actually if it is firewall problem, win7 will not allow client (run on Ubuntu) to access to server from the beginning. However, the client can run until the last code line. It means that win7 allow client to access to server. Do you think so? – John Feb 12 '11 at 08:31
  • Ah i thougth that there was no communication before the exception. You mean the problem is that the win7 server gets some data and the exception is thrown when the server sends some data to the client? If this is the case your error is really strange because the other way works (ubuntu as server). GL finding the source of this error. – kasten Feb 12 '11 at 09:03

0 Answers0