views:

44

answers:

3

I'm having a problem where a socket appears to be closing by itself.

Here's the (edited) network diagnostic trace:

Exiting Socket#62696216::BeginSend()
Exiting Socket#62696216::EndSend()
Socket#62696216::BeginSend()
Exception in the Socket#62696216::BeginSend - An established connection was aborted by the    software in your host machine

Notice that there's a successful send and then there's an error. The error says that the socket was closed locally (i.e. on the host machine), and yet Close was not called. It's an intermittent error, which only happens perhaps once in a thousand times.

How did the socket end up being closed?

I feel like there must be a really simple answer, but it's eluded me for hours. Any help would be much appreciated.

Thank you

A: 

Could be a number of things.. -timeout -number of sockets opened on your host machine exceeded limit -bug in your code

Without seeing the code or knowing the environment it would be difficult to determine.

juxstapose
A: 

This is what it would look like if a kernel-mode antivirus chose to block the transfer.

Ben Voigt
A: 

This will usually mean one of two things. Either you have a firewall or an antivirus that considers your program to be malicious, or (more likely if it only happens once in a while) one of the previous sends times out and that makes the system close the socket. As far as I know, the fact that EndSend returns without signaling an error does not really mean that the data has been physically delivered to the destination server.