java.net.SocketException: Software caused connection abort

For the reason analysis, you can see the detailed explanation of the TCP closed state
https://www.cnblogs.com/borey/p/5626124.html

The above picture is the state transition diagram of the passive closing party of the tcp connection
(1) After receiving the FIN from the peer, close the read channel Enter the CLOSE_WAIT state
(2) Wait for the application layer to call the close function to close the connection in the CLOSE_WAIT state
(3) If close is called within the timeout period, enter the LAST_ACK state; otherwise, directly enter the CLOSED state
(4) In the LAST_ACK state, send FIN to the pair (5) If the
confirmation ACK is received within the timeout period, it will enter the CLOSED state, otherwise it will directly enter the CLOSED state.
The following is my test result, which is consistent with the article explanation 1: java.net.SocketException: Software caused connection abort: recv failed The peer adjusted close, and the local is still reading on the corresponding socket Note: This exception will be thrown immediately because the read channel has been closed 2.java.net.SocketException: Software caused connection abort: socket write error The peer has adjusted close, and the local is still writing on the corresponding socket. Note: This exception will not be thrown immediately, that is, it will not be immediately perceived. It will only be thrown after writing data after a period of time. If the local has been writing data , the former will not throw an exception, and the latter will throw an exception.










Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326026621&siteId=291194637