Archived Forum Post

Index of archived forum posts

Question:

An established connection was aborted by the software in your host machine. WindowsErrorCode: 0x2745

Nov 20 '15 at 09:25

What is the meaning of this error?

An established connection was aborted by the software in your host machine. WindowsErrorCode: 0x2745


Answer

This error:

WindowsError: An established connection was aborted by the software in your host machine. WindowsErrorCode: 0x2745

Is caused by the following sequence of events, which could apply to any protocol (SMTP, HTTP, IMAP, FTP, SSH, SFTP, etc.)

  1. The client sends something to the server.
  2. The server dislikes what it receives, for whatever reason, decides to close the connection.
  3. The client then attempts to read the connection -- and it finds the connection has already been closed. Thus the message ("An established connection was aborted by the software in your host machine.")

When the server decided to close the connection, its TCP "close" socket operation results in a "FIN" segment being sent to its peer (the client). The Windows OS receives it and thus the connection becomes closed. The next time the application tries to read/write the connection, it finds it's already been closed.

To debug a problem such as this, the question becomes: "What was wrong with the last message sent to the server? Was it properly formatted (i.e. was the client software working correctly?), or was the message formatted properly, but the contents of the message were unacceptable?" With Chilkat, it is far more likely that the latter is the cause.

One way to find out why the SSH server is closing the connection, is to run the SSH server with verbose/debug logging, and run it interactively for the test. For example, assuming the SSH server is on a Linux box, go to that box and stop the SSH server ("sudo kill -9 <pid>")

Then start sshd interactively as shown below. You may have to give the full path to the sshd..

sudo /home/chilkat/openssh-7.1p1/sshd -Dde

You should see verbose/debug logging from sshd emitted to the output. Then run your app. You should see the sshd receive the connection -- and if it dislikes something, you should see the sshd's debug logging to the stdout giving some details as to why it disconnects the client.