Is there any good cross-platform C++ library for P2P networking (preferably UDP but TCP would work also). Originally I planned to use libjingle but since they do not provide any precompiled libraries and sport a quite messy build system I currently set it aside as too complicated.
libtorrent.org build on top of boost, boost-asio is a library for P2P work good for me. It implement BitTorrent protocol, using TCP for transport data, TCP/UDP for peer exchange.
libnice - Implements ICE protocol.
One possible option is our MsgConnect product. Open-source license is available.
libjingle can be a pain to compile,but it's very powerful and the api is pretty straight forward, the sample applications help you learn and understand it better.
it a cross-platform p2p client but it offer its open source API as well. It implements many non standard features like P2P video streaming, DHT, Merkle Hashes, repex, NAT and firewall puncturing, ...
Its engine is part of an European-founded video streaming project: p2p-next.
Unfortunately it's written in python, but you can wrap it in c++ or even generate c++ libraries out of python.
Alternatively: libswift
I like SDL_net. It manages both UDP and TCP communication protocols. It is available for MAC, WINDOW & LINUX distributions, lightweight and quite easy to implement.
Its website is not the best looking but has good documentation with demos, you can get inspired from.
来源:https://stackoverflow.com/questions/10982062/p2p-library-for-c