Accept method allows operations on connection
This commit is contained in:
parent
0df1192679
commit
1184ebd8bf
2 changed files with 3 additions and 5 deletions
|
|
@ -50,7 +50,7 @@ int Socket::winListen()
|
|||
return 0;
|
||||
}
|
||||
|
||||
int Socket::winAccept(){
|
||||
SOCKET Socket::winAccept(){
|
||||
while(Socket::running){
|
||||
SOCKET clientSocket = accept(mainSocket, NULL, NULL);
|
||||
if(clientSocket == INVALID_SOCKET){
|
||||
|
|
@ -58,8 +58,6 @@ int Socket::winAccept(){
|
|||
continue;
|
||||
}
|
||||
log.info("Client connected");
|
||||
// handling client starts here
|
||||
closesocket(clientSocket);
|
||||
return clientSocket;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,5 +22,5 @@ public:
|
|||
int winInit();
|
||||
int winBind();
|
||||
int winListen();
|
||||
int winAccept();
|
||||
SOCKET winAccept();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue