I was wondering if there was an API to do networking that would work on Windows, Mac and Linux. I would like to make a card game that 2 people can play through a TCP connection.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are a few options for this, some easier to use than others:
APR (Apache Portable Runtime) – Very popular. Quite easy to use. Includes lots of additional features handy for network programming (threads, mutexes, etc.)
ACE – Popular among the embedded space. Personally, I found it quite a complicated API, and not very straightforward to use.
Boost – If you have a decent level of sophistication with C++ (templates, metaprogramming, etc.), then Boost libraries are generally very good. I’m not sure how popular the Boost asynchronous networking libraries are in the real world.
QT – Popular as a UI toolkit, but has a great set of threading, event management, networking libraries. IMO, this is by far the easiest to use.
It’s important to stay away from using the berkeley sockets library, as the implementations across operating systems vary wildly, and you’ll lose a fair bit of time to tuning them as you port your software across OSs.
My personal preference: APR.