What is the best way to go about making a C++ server

i got a simple word game i made and want to make it work online so you can verse another player. Im a C guy and the idea i have so far is to write a server and client with the socket and read functions. Since im using C++, which is new to me, is there a better way? I would really appreciate some input.
You can use POCO http://pocoproject.org/docs/ for that purpose. You need a relatively good understanding of C++. But it's worh while.
If you're on Windows you'd probably best be off using Winsock. It mostly uses the Berkeley sockets API, so it will still be kinda semi-portable.
Also think ahead and make it IPv6! ;)
Here you'll find some (pretty messy, since they're in plain C) examples for Winsock compatible with IPv6:
Server:
http://www.tenouk.com/Winsock/Winsock2example10.html
Client:
http://www.tenouk.com/Winsock/Winsock2example11.html
That plus the msdn library should help you out.
For games, you could always use the networking from SFML, you could also do the graphics in said library =)

Sockets are probably overpowered for your project, you'd have to do an awful lot of thinking and learning to start networking your players (Maybe not, you could be a (genious)edit: oh the irony, with miiind powers)

However if you don't find any other resources you should look at beej's guide, and look at some example code. It is fairly straightforward, just a little difficult to start cold in.
Last edited on
thanks a lot guys. ill look into the windows sockets
Topic archived. No new replies allowed.