Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sockets under Windows XP OS

 
Sree Nivas
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

A simple Java socket programming is not working in windows XP home edition OS. I'm getting the following error. I'm running server in one DOS window and client in another DOS window. daytimeClient is my client program name.

java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at daytimeClient.main(daytimeClient.java:11)

But the same server and client programs are working fine in my work pc. Windows XP OS is not supporting Java socket programming or some other reason?
Pl clarify.

regards
Sreenivas
 
Joe Ess
Bartender
Posts: 9279
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have the XP Internet Connection Firewall running?
 
Sree Nivas
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes or No. I'm not sure about this. But I have internet connection. Pl tell me if Yes what to do or if no what's the solution?

regards
Sreenivas
 
Sree Nivas
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As described in archive, I enabled firewall and created manually port for my java socket program and tried. But still my client program is not running and giving same error message.

Also tried by disabling firewall, still same problem is occuring.

Could any tell me the what's wrong in running Java sockets in XP home edition OS. The same programs (Server & client) running in my work pc fine.

regards
Sreeni
 
jeff willis
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
During times like this, I like to just try to ping the client from the server and visa versa.

If you cannot do that, then at least we can eliminate JAVA as a possible suspect here.
 
Paul Santa Maria
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi -

1. I'm curious if you made any progress resolving this problem since your first post last Sep 23 (a little over a week ago).

2. "TCP/IP is TCP/IP", and "sockets are sockets". So no, in general, it should *not* be an issue whether or not the program is written in Java or not.

3. The specific error, "Connection refused", indicates that your (XP?) server process failed to connect to your (Java?) client - i.e. that the first place to look for the source of the problem is on the *server* side.

4. The key question is "What's different between the (XP?) client that works and the Java client that fails?

Do both clients execute on the same host? The same OS? Can you run *both* clients in a different window at the same time, and have only one fail?

5. Perhaps the best tool for answering question 4) is "Ethereal" (www.ethereal.org).

Good luck - and please let us know what happens!

Your .. PSM
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic