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.
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).