Finished accept method in socketer
This commit is contained in:
parent
8fec22b413
commit
c1bc2067c8
3 changed files with 13 additions and 16 deletions
12
src/main.cpp
12
src/main.cpp
|
|
@ -16,16 +16,8 @@ int main() {
|
|||
socket.winBind();
|
||||
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);
|
||||
}
|
||||
socket.running = true;
|
||||
socket.winAccept();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue