J
John_Woo
Hi,
One machine runs as socket server, talking to other machines (both
sides, socket keep
running, never being closed).
The problem over this communnication is that, whenever a cable
unplugged,
the server app has to be restarted, so the client-machine can get
reconnection again.
the client side code snippet is:
Socket send = new Socket(ip, port);
the exception is
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.ja
at java.net.PlainSocketImpl.connectToAddress(PlainSocket
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at java.net.Socket.<init>(Socket.java:365)
at java.net.Socket.<init>(Socket.java:178)
Can any one tell how to fix it?
One machine runs as socket server, talking to other machines (both
sides, socket keep
running, never being closed).
The problem over this communnication is that, whenever a cable
unplugged,
the server app has to be restarted, so the client-machine can get
reconnection again.
the client side code snippet is:
Socket send = new Socket(ip, port);
the exception is
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.ja
at java.net.PlainSocketImpl.connectToAddress(PlainSocket
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at java.net.Socket.<init>(Socket.java:365)
at java.net.Socket.<init>(Socket.java:178)
Can any one tell how to fix it?