views:

148

answers:

4

I basically am looking for a cross platform way to do basic things such as accept connections and send and receive data. What library would work in Linux, Windows and Mac?

Thanks

+3  A: 

For C++
http://pocoproject.org/documentation/index.html
http://www.boost.org/

Of course you can always look here:
http://stackoverflow.com/questions/1587252/what-is-a-popular-multi-platform-free-and-open-source-socket-library

Romain Hippeau
+1 for Boost. There are reasons pro and con using Boost in your projects, but once you have Boost as a dependency anyway (and it's hard these days not to), using its features to the fullest is a good choice IMHO. Direct link to Boost::Asio: http://www.boost.org/doc/libs/1_43_0/doc/html/boost_asio.html
DevSolar
+6  A: 

Winsock is based on the BSD sockets API, which is natively supported on both Linux and OS X (ie. socket(), connect(), accept(), send(), recv(), select() and so forth).

There are some differences, but they are such that it's usually easier to port from Winsock to true BSD sockets than the reverse.

caf
+1  A: 

I would suggest Qt. It has a great slot/signal paradigm that makes threaded socket programming easy.

George Edison
A: 

Boost's ASIO is a good choise; I'd suggest struggle to understand it and stick to it - it covers most of the things you'll want.

Poni