Skip to main content
GameDev.net gamedev.net
🔒 Locked

Basic UDP ... wrapper?

Started by shadowman13131 Jan 25, 2006 at 1:08 AM 1 replies 2.2k views
Original Post
shadowman13131
shadowman13131
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.h UDPProt.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 :)
Borundin
Borundin
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!
shadowman13131
shadowman13131
Thanks :) Good luck to you too. That's pretty much what I was looking for. Either flame, or ok-so-far. :P

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.