Treat WSAEINVAL similar to WSAEALREADY during connect for backward-compatibility to Winsock 1.1, but might confuses with an actual invalid argument error on newer Winsock.

This commit is contained in:
ANR2ME committed 2023-08-26 06:25:09 +07:00
1 parent 564c4b38bd
commit 47efec2782
1 file changed
+1 -1
+1 -1
View File
@@ -84,7 +84,7 @@
#define EALREADY WSAEALREADY
#define ETIMEDOUT WSAETIMEDOUT
#define EOPNOTSUPP WSAEOPNOTSUPP
inline bool connectInProgress(int errcode){ return (errcode == WSAEWOULDBLOCK || errcode == WSAEINPROGRESS || errcode == WSAEALREADY); }
inline bool connectInProgress(int errcode){ return (errcode == WSAEWOULDBLOCK || errcode == WSAEINPROGRESS || errcode == WSAEALREADY || errcode == WSAEINVAL); } // WSAEINVAL should be treated as WSAEALREADY during connect for backward-compatibility with Winsock 1.1
inline bool isDisconnected(int errcode) { return (errcode == WSAECONNRESET || errcode == WSAECONNABORTED || errcode == WSAESHUTDOWN); }
#else
#define INVALID_SOCKET -1