An Established Connection Was Aborted by the Software in Your Host MAChine

C# An established connection was aborted by the software in your host machine


An established connection was aborted by the software in your host machine

That is a boiler-plate error message, it comes out of Windows. The underlying error code is WSAECONNABORTED. Which really doesn't mean more than "connection was aborted". You have to be a bit careful about the "your host machine" part of the phrase. In the vast majority of Windows application programs, it is indeed the host that the desktop app is connected to that aborted the connection. Usually a server somewhere else.

The roles are reversed however when you implement your own server. Now you need to read the error message as "aborted by the application at the other end of the wire". Which is of course not uncommon when you implement a server, client programs that use your server are not unlikely to abort a connection for whatever reason. It can mean that a fire-wall or a proxy terminated the connection but that's not very likely since they typically would not allow the connection to be established in the first place.

You don't really know why a connection was aborted unless you have insight what is going on at the other end of the wire. That's of course hard to come by. If your server is reachable through the Internet then don't discount the possibility that you are being probed by a port scanner. Or your customers, looking for a game cheat.

An established connection was aborted by the software in your host machine

This problem can be simply solved by closing Eclipse and restarting it. Eclipse sometimes fails to establish a connection with the Emulator, so this can happen in some cases.

C# - an established connection was aborted by the software in your host machine Error

Setting the correct Content-Length fixed it.

If Content-Length is greater than the actual length, the client-side will continue to wait for the remaining parts of the response. But since the server is already done with sending the response, it will end the process.

An established connection was aborted by the software in host machine

Probably because you're breaking the while loop (look my comment)

while (true)
{
Socket handler = listener.Accept();
data = null;

while (true)
{
bytes = new byte[1024];
int bytesRec = handler.Receive(bytes);

data += Encoding.ASCII.GetString(bytes, 0, bytesRec);
TextRecieved = data;
Thread textbox = new Thread(new ThreadStart(WriteInReachTextBox));
textbox.Start();

// -----------> HERE!!!!!!

break;
}

//uirtbreport.Text = data;
byte[] msg = Encoding.ASCII.GetBytes(data);
handler.Send(msg);
handler.Shutdown(SocketShutdown.Both);
handler.Close();
}

Why do you create a thread within the 'broken' loop?

Also, don't forget this is a streaming socket, which means that 'packets' can be sent as one buffer or split into multiple 'packets'.

java.io.IOException: Connection was aborted by the software in your host machine with Sendkey() in selenium java

This error message...

java.io.IOException: java.util.concurrent.ExecutionException: 
java.io.IOException: Connection was aborted by the software in your host machine

...implies that the exception was raised due to concurrent execution.

As per the discussion ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine with GeckoDriver and Firefox this issue is observed when you attempt to invoke sendKeys() when a JavaScript / jQuery was still active.

Solution

The solution will be to induce WebDriverWait for the JavaScript / jQuery to complete using either of the ExpectedConditions:

  • elementToBeClickable(By locator): An expectation for checking an element is visible and enabled such that you can click it.
  • elementToBeClickable(WebElement element): An expectation for checking an element is visible and enabled such that you can click it.


Related Topics



Leave a reply



Submit