server up and client receives java.net.ConnectException: Connection refused
Hi,
I have a typical client/server application and I am having some problems. At the beginning I always can connect from the client to the server. However if I restart the server and the client only sometimes can connect and some others I receive the following:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(DashoA6275)
I am using java 1.4.2. I think it has something to do with leaving the socket port opened when I finish the program but I don't see anything with netstat -a | grep port_number and also I have a socketInstance.close() in a finalize method in my program.
Any idea?
Thanks in advance,

