Minimal fixed loop to stop the immediate exit
This commit is contained in:
parent
d0c1bc5074
commit
660f2f8d94
1 changed files with 11 additions and 0 deletions
11
src/main.cpp
11
src/main.cpp
|
|
@ -16,6 +16,17 @@ int main() {
|
||||||
socket.winBind();
|
socket.winBind();
|
||||||
socket.winListen();
|
socket.winListen();
|
||||||
|
|
||||||
|
running = true;
|
||||||
|
while(running){
|
||||||
|
SOCKET clientSocket = accept(socket.mainSocket, NULL, NULL);
|
||||||
|
if(clientSocket == INVALID_SOCKET){
|
||||||
|
log.err("Accept failed: " + std::to_string(WSAGetLastError()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
log.info("Client connected");
|
||||||
|
closesocket(clientSocket);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue