Using C and the Winsock library (UDP), I made a client-server multiplayer game.
Now I would like to make it so clients can be connected directly to each other (for example in Warcraft III when someone hosts a game the other players connect directly to him), but I do not know and could not find information on how to do this.
For the most part – especially in today’s unfortunate world where most clients are behind NAT firewalls and ISPs that block so many incoming connections – client/server programs such as what you’re looking to do will route all traffic through the central server, which is “guaranteed” to be accessible from all clients.
Otherwise, you’ll want to look into UPnP, and/or something like UDP hole punching to achieve access between clients that may be behind the constraints listed above.