03-10-2008, 05:56 PM
IOCP Tutorial: viewtopic.php?f=69&t=895
All unedited MS version have a check in ServerLogic if the socket state is above 7 (state 8 and 9 is closing state and error state). And this check is done to see if the player has encountered problems:
And I'd like to add that to my game. Same things goes for the isconnected function, but here it checks:
But in IOCP, it doesn't check if a player got disconnected in the gameai loop, and the isconnected function only checks if the socket is empty or not. And I believe a socket can have something in it eventhough the client is messed up and not receiving/sending data.
So the code above can't be used in the gameai loop to check for state>7.
Now I'd like to add a check like that with the state > 7 in the game loop. But how would I do that?
All unedited MS version have a check in ServerLogic if the socket state is above 7 (state 8 and 9 is closing state and error state). And this check is done to see if the player has encountered problems:
Code:
If frmServer.Socket(i).State > 7 Then
Call CloseSocket(i)
End If
Code:
If frmServer.Socket(Index).State = sckConnected Then
Code:
If Not GameServer.Sockets(index).Socket Is Nothing Then
Now I'd like to add a check like that with the state > 7 in the game loop. But how would I do that?