1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Properly handle tcp connection failure

This commit is contained in:
Fabio Alessandrelli
2016-12-08 19:59:16 +01:00
parent cdc1ca0f13
commit 4f07b595a1
2 changed files with 12 additions and 2 deletions

View File

@@ -107,7 +107,12 @@ Error StreamPeerTCPPosix::_poll_connection(bool p_block) const {
return OK;
};
if (errno == EINPROGRESS || errno == EALREADY) {
return OK;
}
status = STATUS_ERROR;
return ERR_CONNECTION_ERROR;
} else {
status = STATUS_CONNECTED;

View File

@@ -98,7 +98,12 @@ Error StreamPeerWinsock::_poll_connection(bool p_block) const {
return OK;
};
if (errno == WSAEINPROGRESS || errno == WSAEALREADY) {
return OK;
}
status = STATUS_ERROR;
return ERR_CONNECTION_ERROR;
} else {
status = STATUS_CONNECTED;