I found a client/server code and I am getting this error:
java.net.SocketException: Software caused connection abort: recv failed
There are some issues related to Firewall. Please turn off Firewall or else, connect your internet to wifi/personal wifi. These solution worked for me.
In my case it was related to Client authentication. It happened to me when I was trying to access SOAP API from Java code without setting keystore/keystorePassword and from the stacktrace there is no way we can figure out that there's a problem with Authentication.
After I added following lines before making call to SOAP API and it worked as expected.
System.setProperty("javax.net.ssl.keyStoreType", "Your Cert Type");
System.setProperty("javax.net.ssl.keyStore", "Your cert path");
System.setProperty("javax.net.ssl.keyStorePassword", "Password");
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());