Cause of “Software caused connection abort: recv failed”

前端 未结 3 1897
时光取名叫无心
时光取名叫无心 2021-01-20 18:35

I found a client/server code and I am getting this error:

java.net.SocketException: Software caused connection abort: recv failed

相关标签:
3条回答
  • 2021-01-20 18:55

    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.

    0 讨论(0)
  • 2021-01-20 18:58

    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");
    
    0 讨论(0)
  • 2021-01-20 19:00

    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());
    
    0 讨论(0)
提交回复
热议问题