Official reasons for
Official reasons for "Software caused connection abort: socket write error"
Given this stack trace snippet
Caused by: java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
I tried to answer the following questions:
- What code is throwing this exception? (JVM?/Tomcat?/My code?)
- What causes this exception to be thrown?
Regarding #1:
Sun's JVM source doesn't contain this exact message, but I think the text Software caused connection abort: socket write error is from the native implementation of SocketOutputStream
:
private native void socketWrite0(FileDescriptor fd, byte[] b, int off, int len) throws IOException;
Regarding #2
My guess is that it is caused when the client has terminated the connection, before getting the full response (e.g. sent a request, but before getting the full response, it got closed / terminated / offline)
Questions:
- Are the above assumptions correct (#1 and #2)?
- Can this be diffrentiated from the situation: "could not write to the client, due to a network error on the server side"? or would that render the same error message?
- And most important: Is there an official document (e.g from Sun) stating the above?
I need to have a proof that this stack trace is the socket client's "fault", and there is nothing that the server could have done to avoid it. (except catching the exception, or using a non Sun JVM SocketOutputStream, though both don't really avoid the fact the client has terminated)
Answer by Brian Agnew for Official reasons for "Software caused connection abort: socket write error"
Have you checked the Tomcat source code and the JVM source ? That may give you more help.
I think your general thinking is good. I would expect a ConnectException
in the scenario that you couldn't connect. The above looks very like it's client-driven.
Answer by stacker for Official reasons for "Software caused connection abort: socket write error"
To prove which component fails I would monitor the TCP/IP communication using wireshark and look who is actaully closing the port, also timeouts could be relevant.
Answer by EJP for 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'.
Answer by user2028913 for Official reasons for "Software caused connection abort: socket write error"
I have seen this most often when a corporate firewall on a workstation/laptop gets in the way, it kills the connection.
eg. I have a server process and a client process on the same machine. The server is listening on all interfaces (0.0.0.0) and the client attempts a connection to the public/home interface (note not the loopback interface 127.0.0.1).
If the machine is has its network disconnected (eg wifi turned off) then the connection is formed. If the machine is connected to the corporate network (directly or vpn) then the connection is formed.
However, if the machine is connected to a public wifi (or home network) then the firewall kicks in an kills the connection. In this situation connecting the client to the loopback interface works fine, just not to the home/public interface.
Hope this helps.
Answer by PRO_gramista for Official reasons for "Software caused connection abort: socket write error"
For anyone using simple Client Server programms and getting this error, it is a problem of unclosed (or closed to early) Input or Output Streams.
Answer by chitra b for Official reasons for "Software caused connection abort: socket write error"
See whether your local windows firewall is turned off/on. If it is on, just Turn off the firewall. You wont face the connection abort: socket error problem. I have tried and it worked.
Answer by Sefi Erlich for Official reasons for "Software caused connection abort: socket write error"
My server was throwing this exception in the pass 2 days and I solved it by moving the disconnecting function with:
outputStream.close(); inputStream.close(); Client.close();
To the end of the listing thread. if it will helped anyone.
Answer by NIV214 for Official reasons for "Software caused connection abort: socket write error"
I was facing the same issue.
Commonly This kind of error occurs due to client has closed its connection and server still trying to write on that client.
So make sure that your client has its connection open until server done with its outputstream.
And one more thing, Don`t forgot to close input and output stream.
Hope this helps.
And if still facing issue than brief your problem here in details.
Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72
0 comments:
Post a Comment