Mirage Source
IOCP Help - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: IOCP Help (/showthread.php?tid=2216)



IOCP Help - William - 03-10-2008

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:
Code:
If frmServer.Socket(i).State > 7 Then
            Call CloseSocket(i)
        End If
And I'd like to add that to my game. Same things goes for the isconnected function, but here it checks:
Code:
If frmServer.Socket(Index).State = sckConnected Then
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.
Code:
If Not GameServer.Sockets(index).Socket Is Nothing Then
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?


Re: IOCP Help - William - 04-10-2008

According to Verrigans way of programming, that would be the case. But I can't rely on him since he doesn't visist ms anymore.


Re: IOCP Help - Dragoons Master - 09-10-2008

I'll help you guys out when I have more time ><
I have IOCP running on my server. Works like heaven.


Re: IOCP Help - William - 09-10-2008

Dragoons Master Wrote:I'll help you guys out when I have more time ><
I have IOCP running on my server. Works like heaven.
Yeah well it works for me too. But I seem to have something wrong with my server and Im trying to figure out whats casuing it. Hence the topic. But I always appreciate help.