From ab0dcb22a64cdb9d18666652efcfe3113a00e560 Mon Sep 17 00:00:00 2001 From: InvisibleMan Date: Mon, 26 Jul 2021 22:17:26 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8Dwindows=E4=B8=8Bconne?= =?UTF-8?q?ct=E8=BF=94=E5=9B=9E=E5=80=BC=E5=BC=82=E5=B8=B8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libgo/netio/windows/win_vc_hook.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libgo/netio/windows/win_vc_hook.cpp b/libgo/netio/windows/win_vc_hook.cpp index 5b9b3e3d..94295828 100644 --- a/libgo/netio/windows/win_vc_hook.cpp +++ b/libgo/netio/windows/win_vc_hook.cpp @@ -344,7 +344,7 @@ namespace co { return 0; } - if (res < 0 && WSAGetLastError() != WSAEINPROGRESS) { + if (res < 0 && WSAGetLastError() != WSAEWOULDBLOCK) { ErrnoStore es; setNonblocking(s, false); return res; @@ -362,6 +362,7 @@ namespace co { int err = 0; int errlen = sizeof(err); getsockopt(s, SOL_SOCKET, SO_ERROR, (char*)&err, &errlen); + setNonblocking(s, false); if (err) { WSASetLastError(err); return -1;