   general client/server questions
  Hey,  I am trying to write my first client/server based game.  I have a basic game loop in which I need to get info from the server about other clients.  I want to use the method socket.receive.  I also want to timeout this receive method so that it doesn't halt my game loop.  Can I use the sotimeout variable or do I have to use threads?  Ben[Edited by - livesWithParents on April 4, 2010 6:05:21 PM]
  Hey,  Another thing I am wondering about is how the server might handle receiving packets which are meant to contain different types of information.  For instance, a packet might come in a type, like player player name, and the packet is structured to have just the player's name.  Then another packet might be set up to have some object of some class and its been serialized.  So, how should the server be written to handle this.  I mean, can the server just loop receiving packets, determine which type the packet is and then send it to the appropriate method for processing?  Should there be a seperate thread for each type of packet and that thread is designed to listen on a specific port for that type of packet and then it processes that packet in its own way...?   ;  You need to look up async callbacks, or multithreading.  I prefer the async callbacks for my client/server apps.theTroll   