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.
-
4What do you mean by P2P networking? What kind of communication do you want to achieve? Is this file transfer, chat, voice, video? Is this point to point or point to multi-point communication? – Zuljin Jun 11 '12 at 14:38
-
From my experience I can at least tell everyone to stay away from _enet_, since it is quite buggy. – abergmeier Sep 20 '12 at 09:57
-
2ProudNet also provide P2P networking including hole punching and relaying. Features include remote procedure call, UDP-like and TCP-like messaging, encryption, compression, etc. – Hyunjik Bae Nov 21 '15 at 12:41
5 Answers
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.

- 7,649
- 5
- 35
- 52
-
-
1can libtorrent/BitTorrent be used as a general purpose P2P networking library/protocol? – Erik Kaplun Mar 08 '16 at 01:36
-
@ErikAllik libtorrent ís not design to be a general P2P network library, but you can learn with it. – secmask Mar 10 '16 at 03:14
-
1but the question was about P2P in general, no? and it would be nice if libtorrent could be used more generally than file sharing. – Erik Kaplun Mar 10 '16 at 08:47
One possible option is our MsgConnect product. Open-source license is available.

- 45,135
- 8
- 71
- 121
-
1software that doesn't have an open source GitHub repo nowadays starts to feel a bit like not software at all, in a way :) – Erik Kaplun Mar 10 '16 at 08:49
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.

- 7,281
- 12
- 44
- 72
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

- 2,297
- 17
- 30