There are several ways of handling sockets eg. event-driven, message-driven, blocking, non-blocking, and so on. Depending on which method an application is using, it may display slightly different behaviour from other applications. mIRC uses the non-blocking message-driven method. After applying the fix I mentioned, I am still able to reproduce the 10053 issue occasionally, though not as much as before. Since mIRC is processing Windows socket messages in the order that they are sent by Winsock, this seems to indicate that the issue is due to timing ie. a combination of connection roundtrip time, threading delays, Windows messaging lag, etc. and that Winsock may send the socket messages in a different order depending on that.