views:

632

answers:

4

Hi all!

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?

+4  A: 

enet suits your needs

  • simple
  • fast
  • reliable UDP
  • intended for real time multiplayer games

It's not object-oriented though.

Samuel_xL
I suppose I could wrap it in a class if needed.
Joe Zephyr
+3  A: 

Raknet is amazingly good. So good that is the basis for networking in commercial engines like unity3d. http://www.jenkinssoftware.com

Clay Fowler
This one's packed with features!
Joe Zephyr
I really like this one, as according to the site, it has some security features as well as an updater etc!
Joe Zephyr
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!
Joe Zephyr
+6  A: 

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.

Cwan
I second this. When I chose enet, boost.asio was not yet released, but it's a great choice.
Samuel_xL
But does boost.asio give you anything but cross platform async I/O ? Surely this question is asking for more than that?
Len Holgate
@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
Cwan
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
+2  A: 

You might want to look at the answers to this question: http://stackoverflow.com/questions/107668/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.

Len Holgate