You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Return an error code when address/port already in use
This commit is contained in:
@@ -93,6 +93,9 @@ Error TCPServerPosix::listen(uint16_t p_port,const List<String> *p_accepted_host
|
|||||||
close(sockfd);
|
close(sockfd);
|
||||||
ERR_FAIL_V(FAILED);
|
ERR_FAIL_V(FAILED);
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ERR_ALREADY_IN_USE;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (listen_sockfd != -1) {
|
if (listen_sockfd != -1) {
|
||||||
|
|||||||
@@ -86,6 +86,9 @@ Error TCPServerWinsock::listen(uint16_t p_port,const List<String> *p_accepted_ho
|
|||||||
closesocket(sockfd);
|
closesocket(sockfd);
|
||||||
ERR_FAIL_V(FAILED);
|
ERR_FAIL_V(FAILED);
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ERR_ALREADY_IN_USE;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (listen_sockfd != INVALID_SOCKET) {
|
if (listen_sockfd != INVALID_SOCKET) {
|
||||||
|
|||||||
Reference in New Issue
Block a user