Network Error


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


Labels

adsense (5) Algorithm (69) Algorithm Series (35) Android (7) ANT (6) bat (8) Big Data (7) Blogger (14) Bugs (6) Cache (5) Chrome (19) Code Example (29) Code Quality (7) Coding Skills (5) Database (7) Debug (16) Design (5) Dev Tips (63) Eclipse (32) Git (5) Google (33) Guava (7) How to (9) Http Client (8) IDE (7) Interview (88) J2EE (13) J2SE (49) Java (186) JavaScript (27) JSON (7) Learning code (9) Lesson Learned (6) Linux (26) Lucene-Solr (112) Mac (10) Maven (8) Network (9) Nutch2 (18) Performance (9) PowerShell (11) Problem Solving (11) Programmer Skills (6) regex (5) Scala (6) Security (9) Soft Skills (38) Spring (22) System Design (11) Testing (7) Text Mining (14) Tips (17) Tools (24) Troubleshooting (29) UIMA (9) Web Development (19) Windows (21) xml (5)