Basic UDP ... wrapper?
Heyo, I'm just curious if this looks like a decent UDP setup... I mean, it's basic functionality. It doesn't even include any connection handling. It is raw send/receive work. And I was curious what you all thought of the code. It's a VERY straightforward class, look at the header for functionality. It just has sendTo, reliableSendTo, and sequenceSendTo. sendto can have packet loss, reliable always reaches the target, and sequenced sends always arrive in order. Any critique/improvement suggestions of ANYTHING is welcome. I'm just curious what you think of this initial setup. Here are the links: UDPProt.hUDPProt.cpp And a console application that just tests the code... UDPProtocol.cpp Thanks! Walt Woods PS: Note that the SIM_LAG and SIM_LOSS defines are used to simulate (in a somewhat poor fashion) network lag and packet loss. Packet loss is in percent out of 100, and SIM_LAG is double how often in milliseconds to introduce a 350 ms lag. Yeah, SIM_LAG's a sort of bad way of doing it. But it helped fix a bug, so meh. Oh, and if you want to actually use this code, go for it by all means. But do be kind enough to tell me :)
You really should mention the "reliable" part in the topic :)
Anyway, its looking good. Unfortunately, in my current project I have invested quite some time in the Enet library so would not want to switch it for another right now.
Good luck with your project!
Anyway, its looking good. Unfortunately, in my current project I have invested quite some time in the Enet library so would not want to switch it for another right now.
Good luck with your project!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement