diff --git a/modules/sockets/sockets.cpp b/modules/sockets/sockets.cpp index 16b26b0d..059d65f5 100644 --- a/modules/sockets/sockets.cpp +++ b/modules/sockets/sockets.cpp @@ -142,7 +142,10 @@ static cell AMX_NATIVE_CALL socket_open(AMX *amx, cell *params) if(nonblocking_socket && (errno == EINPROGRESS || errno == EWOULDBLOCK)) connect_inprogress = true; else + { close(sockfd); + sockfd = -1; + } } else {