   Quick Question
  I am working on making Packet structures, but had a quick question, does each data packet need it's own SOCKET or can I make one SOCKET for them?   
  If it is the server side you would need a socket for each client you have connected. If your a client you only need one socket to talk to the server.So on the server you would have multiple sockets that can all send any number of types of data over the wire to that sockets corresponding client.And on the client side you could send any number of types of data over the wire to your host on one socket. The only time you change a socket is to re-assign it to a new host/client. Just make sure both sides know what to do with the data once it is received.   ;  Note the information in RanBlade's post above applies to TCP servers, not necessarily UDP. When using UDP you can use a single socket for your server, too. So to clarify, no, you don't need one socket per packet you send -- if you use TCP you will need one socket per session (client connection).   ;  Thanks, was not sure with the socket per client can't I make a infinite loop so everytime someone trys to connect it makes a new socket?   ;  You will find that many socket API calls are blocking. That is, they will halt the execution of your program and return only after the operation is complete. If you need concurrency (which you do in a game) the accept() and recv() calls are particularly bad. This is because accept() blocks until a new connection is available, and recv() blocks until there is data to be read on a socket.Many strategies exist to overcome this problem. The most common, and certainly most portable between socket API implementations (read: BSD and Winsock) is the select() call which can poll a set of sockets for read, write and error conditions. Many tutorials are available on the internet that explain select() thoroughly. I also recommend reading the UNIX man pages for the various functions you will need to use.   