Merge pull request #475 from TheoXD/master

Return an error code when address/port already in use
This commit is contained in:
reduz 2014-06-11 01:14:32 -03:00
commit 267ab88c68
2 changed files with 6 additions and 0 deletions

View file

@ -93,6 +93,9 @@ Error TCPServerPosix::listen(uint16_t p_port,const List<String> *p_accepted_host
close(sockfd);
ERR_FAIL_V(FAILED);
};
}
else {
return ERR_ALREADY_IN_USE;
};
if (listen_sockfd != -1) {

View file

@ -86,6 +86,9 @@ Error TCPServerWinsock::listen(uint16_t p_port,const List<String> *p_accepted_ho
closesocket(sockfd);
ERR_FAIL_V(FAILED);
};
}
else {
return ERR_ALREADY_IN_USE;
};
if (listen_sockfd != INVALID_SOCKET) {