On Fri, Jun 3, 2011 at 4:36 PM, Kevin Fishburne
<kevinfishbu...@eightvirtues.com> wrote:

> I inserted a 100 ms delay between packet transmission and this corrected
> the issue. Any insight still appreciated, as I may have to differentiate
> between LAN clients and WAN clients so the delay is only inserted when
> necessary.
the first thing you should do is ask yourself again why you can't use TCP,
as it includes fairly fancy flow-control algorithms that have been honed
over the last 30 years by some very smart engineers.

If you want to stick with UDP, one option is instead of a simple 100msec wait,
use a timer (I assume these packets are sending updates about game state to the
client), for each update, if the last one has been sent less then,
say, 50msec ago, then don't send the
packet, but if more, then send (without a pause)
This means the system updates without any delay, but there is a
maximum rate of packets
being sent to avoid overloading the recipients buffer.
I wouldn't try to have the code figure out WAN versus LAN, there are
so many different network
configurations out there it is often not meaningful, plus it depends
on CPU speed as well as network
speed (you're problem is the network is too fast for the CPU)
. But maybe let users adjust this timeout value,
if they have fast computers and a fast network they may be able to lower it.

Ian

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to