Advertisement

Basic UDP ... wrapper?

Started by January 25, 2006 01:08 AM
1 comment, last by shadowman13131 19 years ago
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!
Advertisement
Thanks :) Good luck to you too. That's pretty much what I was looking for. Either flame, or ok-so-far. :P

This topic is closed to new replies.

Advertisement