   new to networking need some advice
  So I finally started learning network programming and made a basic chat system for two pcs. I'm thinking of making a multiplayer turn based strategy as this seems like it would be much simpler to do first up. When it comes to having multiple connections from clients would you use an array of sockets to send and recieve from each client?Also at some point I was thinking of making a multiplayer mario style platform game. With a game like that would you have the clients send data like player coordinates, any changes to the map, enemies defeated etc to the server and then the server update the other clients?   
  Im not an expert network programmer but i have written a few server / client apps and games (:Having an array of sockets, 1 for each client is a good idea.And for your mario game idea, yeah, have clients send updates to the server and then have the server periodically send updated data to all the clients.That's the simple way to go about it.It gets more complex when you try to put in anti cheating measures, or "prediction" of other player movements to compensate for network lag.But, at the core yes you have the right ideas and are heading in the right direction!   ;  Sounds like the approach that I would use :)   ;  If you, by "array of sockets", mean something like SOCKET sockets[MAX_CLIENTS], I think this may be rather limiting when working on a game. I tend to prefer wrapping the socket within a class that, in addition to handling the I/O operations such as sending and receiving, can also store information relevant to the game itself. Of course, you could get away with the method you suggested, by mapping sockets to player information in some sort of associative container, but I feel this could introduce unnecessary complexity and overhead. Here's some code to show you what I mean:class Connection{public:    Connection(SOCKET socket);    ~Connection();    int Send(const char *buffer, size_t size);    int Receive(char *buffer, size_t size);private:    SOCKET mSocketHandle;    Player *mPlayerPtr; // Pointer to player object.};This allows you to easily associate a network message with the player from whom it originated. Before continuing this project, I suggest you get a solid understanding of handling multiple simultaneous clients. Simply looping the client list and calling recv() on each socket generally won't do. Winsock provides the select() function, which although it may seem complex at first, handles the job perfectly. Look it up on MSDN!Finally, you should embrace the golden rule of multiplayer networking: never ever trust the client. When writing a multiplayer game, you should always assume that behind each client there sits an evil hacker who wants to exploit weaknesses in your network design to gain the advantage in your game. Allowing the client to send its position (without the server checking it), enemies killed, and such information is simply asking for trouble. Instead, have the server run the game, too, but without the graphical side. The server always decides who moves where, who actually killed what monster, etc. Note that it's perfectly fine for clients to "guess" how the game state will look within the next few hundred milliseconds, and display this to the player. This technique is often used to eliminate the visible effects of network latency (lag).   ;  What happens when you break the golden rule is something all EverQuest players are familiar with ;) Warping, invulnerability, knowing the locations and drops for all NPCs, etc. All possible thanks to a client with too much power.I guess you could break the golen rule into two "golden rules".1. As you said, don't allow the client to tell the server what's going on. The server must always dictate to the client.2. Anything that you send to the client can be read by 3rd party programs. Don't send anything to the client that the player shouldn't be aware of! I.e., the location of far away enemies that the player can't see!There are probably others, but those two are important!   