Socket system incomplete?

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Socket system incomplete?

      Hey Mike,

      I have been working with the networking system a bit and have noticed something, correct me if I am wrong but it seems that the deletion flag can be properly set to 1 and the socket will be removed properly, however I am not seeing any way that the socket deletion flag will end up as '3' or '2'. I am having trouble understanding how I would handle these cases which I assume are things such as the player losing a connection momentarily.

      I am assuming that case 3 denotes a 'lost' connection which has not yet been closed, which is than closed and set to '2'.

      Could you walk me through how a connection is determined as lost and than how it would be reconnected? I was under the impression that it would have to do with the socket 'timeout', which also seems unused.

      - Socket 'times out' on the server side
      - The server notices it has timed out for too long
      - closes the connection but does not delete it
      - if it is in this state for too long without reconnection, the socket class is removed
      -otherwise

      If the client tries to reconnect, how should I handle hooking them back up to the right socket class, and how do I determine that a socket is timing out?
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • bump
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • You are indeed correct - the deleteFlag has the lowest bit set by HandleException(), which can be called under many circumstances by WinSock. This flag simply removes the socket from processing, but doesn't delete it.

      It is up to the class that inherits from NetSocket to determine what to do next, which could be to leave the socket around for any further processing or set the deleteFlag's 0x02 bit, which will trigger the socket manager to close the socket and remove it.
      Mr.Mike
      Author, Programmer, Brewer, Patriot