- Home /
UDP Sockets for networking, getting overloaded??
Over the past few months I have been perfecting my networking framework for my game, using UDP.
Everything works flawlessly, that is until I receive packets faster then I can unload them, from which point on, the Socket.Available returns > 63,000 (but not > 64000) and I start passing packets that are 1+ seconds old.
Is there a way to limit my Socket to only keep a buffer of the most recent bytes? Is there a way to unload only the most recent bytes with Socket.RecvFrom, rather than having them stack up?
Edit: Sorry, actively working on this. Another way to explain the problem is, whenever the socket gets data (ready to recv with RecvFrom) it adds those bytes to a queue. When I call recvfrom I am getting whatever was first in, which is now older then the newest data that was queued. Can I make it like a stack, where I unload only the newest data first?