According to http://msdn.microsoft.com/en-us/library/windows/desktop/ms737625%28v=vs.85%29.aspx the correct code to check would be WSAEWOULDBLOCK