diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index b1636abd692..19f1ed4b347 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -107,7 +107,12 @@ Error StreamPeerTCPPosix::_poll_connection(bool p_block) const { return OK; }; - return OK; + if (errno == EINPROGRESS || errno == EALREADY) { + return OK; + } + + status = STATUS_ERROR; + return ERR_CONNECTION_ERROR; } else { status = STATUS_CONNECTED; diff --git a/platform/windows/stream_peer_winsock.cpp b/platform/windows/stream_peer_winsock.cpp index 44c17c73e5e..48dd37e9c44 100644 --- a/platform/windows/stream_peer_winsock.cpp +++ b/platform/windows/stream_peer_winsock.cpp @@ -98,7 +98,12 @@ Error StreamPeerWinsock::_poll_connection(bool p_block) const { return OK; }; - return OK; + if (errno == WSAEINPROGRESS || errno == WSAEALREADY) { + return OK; + } + + status = STATUS_ERROR; + return ERR_CONNECTION_ERROR; } else { status = STATUS_CONNECTED;