Reading UDP stream

Blitz3D Forums/Blitz3D Programming/Reading UDP stream

Reading the stream until there's no info to read could be disastrous especially if you're using just one socket for all clients. Make a client type and pass the new connection socket to the client type socket. Then check each client socket once per cycle for a packet. Reading 1 packet per cycle from each player should be plenty to keep the game smooth. CounterStrike sends anywhere from 10 to 30 packets per second just to give you an idea of what's average for a commercial FPS. But of course it depends on your game type also.