java.net.SocketException: Software caused connection abort: recv failed
This usually means that there was a network error, such as a TCP timeout. I would start by placing a sniffer (wireshark) on the connection to see if you can see any problems. If there is a TCP error, you should be able to see it. Also, you can check your router logs, if this is applicable. If wireless is involved anywhere, that is another source for these kind of errors.
Cause of Software caused connection abort: recv failed
The server isn't waiting for any data from the client, and when the server exits the connection will be closed.
Add a ins.readLine()
to the server code like this:
// Receive message from client i.e Request from client
BufferedReader ins = new BufferedReader(new InputStreamReader(sock.getInputStream()));
System.out.println(ins.readLine());
Official reasons for Software caused connection abort: socket write error
This error can occur when the local network system aborts a
connection, such as when WinSock closes an established connection
after data retransmission fails (receiver never acknowledges data sent
on a datastream socket).
See this MSDN article. See also Some information about 'Software caused connection abort'.
How to fix java.net.SocketException: Software caused connection abort: recv failed
i fixed this probleme by increasing the timeout value in mysql config file = C:\Program Files (x86)\MySQL\MySQL Server 5.1\my.ini :
[mysqld] wait_timeout=2147483 interactive_timeout=2147483
and then i have restarted mysql service.
thank you @EJP
Socket - Software caused connection abort: recv failed
Immediately upon sending a message, the client closes the ObjectOutputStream. This closes the socket's output stream, which closes the socket. By the time the client tries to read from the input stream, the socket is already closed, thus the exception on the client side. This may also be causing the problem on the server side, since by the time the server is reading data, the TCP connection may have been closed.
Java error - Software caused connection abort: recv failed
I couldn't get your exact problem to replicate on my own computer using your code and localhost-connections, but after reading about "BufferedReader.readLine() throwing java.net.SocketException: Software caused connection abort: recv failed" in several different pages, I believe this is related to your network. The connection seems to be terminated due to TCP timeout or data corrupted in the transmission.
If this happens over localhost-connections (server and client in same computer), it could be a faulty memory, otherwise you might have a broken nic, router or cable somewhere along the line. If you're using wireless, they can be pretty unreliable.
Related Topics
Calling Setters from a Constructor
In Java Critical Sections, What Should I Synchronize On
Jackson: How to Add Custom Property to the JSON Without Modifying the Pojo
How to Get the Unique Id of an Object Which Overrides Hashcode()
Calendar.Month Gives Wrong Output
How to Enable the Java Keyword Assert in Eclipse Program-Wise
How to Efficiently Remove All Null Elements from a Arraylist or String Array
Auto-Wiring a List Using Util Schema Gives Nosuchbeandefinitionexception
How to Fix a Compilation Error for Unhandled Exception on Call to Thread.Sleep()
Apache Poi Error Loading Xssfworkbook Class
How to Execute .SQL Script File Using Jdbc
Java's Fork/Join VS Executorservice - When to Use Which