Accept method returns an error correctly

This commit is contained in:
dawidg81 2026-03-08 16:02:50 +01:00
commit b5b0617125

View file

@ -55,7 +55,7 @@ SOCKET Socket::winAccept(){
SOCKET clientSocket = accept(mainSocket, NULL, NULL);
if(clientSocket == INVALID_SOCKET){
log.err("Accept failed: " + std::to_string(WSAGetLastError()));
continue;
return INVALID_SOCKET;
}
log.info("Client connected");
return clientSocket;