Network Error
Client sends message to server, which is down, client outputs the following error:
Exception in thread "main" java.net.SocketException: There is no process to read data written to a pipe.
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
at java.net.SocketOutputStream.write(SocketOutputStream.java:145)
at org.yy.socket.TCPEchoClient.main(TCPEchoClient.java:34)
Client tries to connect the server which is not started, client outputs the following error:
Exception in thread "main" java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:180)
at org.yy.socket.TCPEchoClient.main(TCPEchoClient.java:25)
When peer connection is closed, remote node outputs the following error:
Exception in thread "main" java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:124)
at org.yy.socket.TCPEchoClient.main(TCPEchoClient.java:34)
Create new socket when the cable is disconnected, it outputs the following error:
Exception in thread "main" java.net.SocketException: Network is unreachable
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:391)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:252)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:239)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:389)
at java.net.Socket.connect(Socket.java:551)
at java.net.Socket.connect(Socket.java:501)
at java.net.Socket.<init>(Socket.java:409)
at java.net.Socket.<init>(Socket.java:223)
at org.yy.socket.TCPEchoClient.main(TCPEchoClient.java:33)
After use 'ifconfig en0 down' to disable en0, application outputs "IOException: The network is not currently available".
java.io.IOException: The network is not currently available.
at java.net.PlainDatagramSocketImpl.send(Native Method)
at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:134)
at java.net.DatagramSocket.send(DatagramSocket.java:624)
http://www.ibm.com/developerworks/forums/thread.jspa?threadID=248181&tstart=0
On AIX, Multicast throws "java.net.SocketException: The socket name is not available on this system'
Exception in thread "main" java.net.SocketException: The socket name is not available on this system.
at java.net.PlainDatagramSocketImpl.socketSetOption(Native Method)
at java.net.PlainDatagramSocketImpl.setOption(PlainDatagramSocketImpl.java:347)
at java.net.MulticastSocket.setNetworkInterface(MulticastSocket.java:514)
at MulticastThread.getMulticastSocket(MulticastThread.java:24)
at MulticastThread.<init>(MulticastThread.java:16)
at MulticastThread.main(MulticastThread.java:59)
Fix is to add Java commandline Parameter: -Djava.net.preferIPv4Stack=true