Can anyone recommend an easy to use, fast and reliable C++ API for sending and receiving data over a UDP socket? Maybe something that is specifcally intended for multiplayer games?
Asked
Active
Viewed 5,002 times
4 Answers
7
It's not specifically for gaming, but if you want to get down to the metal and implement your own protocol over UDP, Boost.Asio is really nice.

rjnilsson
- 2,343
- 15
- 20
-
I second this. When I chose enet, boost.asio was not yet released, but it's a great choice. – KeatsPeeks Oct 26 '09 at 19:22
-
But does boost.asio give you anything but cross platform async I/O ? Surely this question is asking for more than that? – Len Holgate Oct 26 '09 at 21:31
-
1@Len: I'm well aware of what asio provides, but the way the question was asked (specifically the "... Maybe ..." part) I figured Boost.Asio could be an interesting choice in case existing frameworks did not fulfill all needs – rjnilsson Oct 27 '09 at 07:21
-
I think I just read the question as asking for more than just a way to send udp using C++, but that might just have been my reading of the question. – Len Holgate Oct 27 '09 at 07:37
-
1Actually, boost is a horrible choice if you want to 'get down to the metal'. *Great* choice if your looking for a high level, easy to use asio pattern - but very limited from a bare metal perspective. – JSON Jul 13 '13 at 14:11
5
enet suits your needs
- simple
- fast
- reliable UDP
- intended for real time multiplayer games
It's not object-oriented though.

KeatsPeeks
- 19,126
- 5
- 52
- 83
-
1
-
1Enet is great if your looking for a low-level, reliable UDP solution. Has the useful bits of the TCP protocol without the bloat. Not just reliable, but also has flow control and congestion avoidance. – JSON Jul 13 '13 at 14:20
5
Raknet is amazingly good. So good that is the basis for networking in commercial engines like unity3d. http://www.jenkinssoftware.com

Clay Fowler
- 2,059
- 13
- 15
-
-
I really like this one, as according to the site, it has some security features as well as an updater etc! – josef.van.niekerk Oct 26 '09 at 19:45
-
I've decided to give RakNet a whirl, it seems very well documented, and has a lot of features that I can benefit from. Not saying the other implementations suggested are bad, I just decided to pick this library. Thanks for the replies! – josef.van.niekerk Oct 28 '09 at 10:23
3
You might want to look at the answers to this question: What do you use when you need reliable UDP?. I developed a C++ version of ENet (which has a C API) for a client and they use it as the basis of their gaming middleware product.

Community
- 1
- 1

Len Holgate
- 21,282
- 4
- 45
- 92