开发者

Crossplatform alternative to Winsock?

开发者 https://www.devze.com 2023-01-11 03:50 出处:网络
I basically am looking for a cross platform way to do basic things suc开发者_Python百科h as accept connections and send and receive data. What library would work in Linux, Windows and Mac?

I basically am looking for a cross platform way to do basic things suc开发者_Python百科h as accept connections and send and receive data. What library would work in Linux, Windows and Mac?

Thanks


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.


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

Of course you can always look here:
What is a popular, multi-platform, free and open source socket library


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消