Connection is half-closed?

I'm currently making a program for sending files from one computer to another.

While I will often be told that the error is, for example, WSAECONNRESET by WSAGetLastError(), the error parameter in the FD_CLOSE event is always WSAECONNABORTED. I can be sending a file, the transfer fails and WSAGetLastError() run after the last send() command returns WSAECONNRESET, but after a little while I receive the FD_CLOSE message and the error code is now WSAECONNABORTED. Should I save the last error code returned by WSAGetLastError() or is the real error sent with the FD_CLOSE message?

Also, what will cause one computer to always return WSAETIMEDOUT as the error in the FD_CONNECT message? Normally when I try to connect to a non-listening computer it will return WSAECONNREFUSED, but this computer always returns WSAETIMEDOUT after trying to connect for 10-20 seconds instead of returning WSAECONNREFUSED after around 1-2 seconds.

Thanks in advance,

-Rune
[994 byte] By [runesvend] at [2007-11-19 18:29:41]