Adds the first pass at an adaptive throttle to slow start new

clients. If the sent packets are ack'ed successfully the throttle
will open quickly up to the maximum specified by the client and/or
the sims client throttle.

This still needs a lot of adjustment to get the rates correct.
This commit is contained in:
Mic Bowman
2011-04-20 16:23:33 -07:00
parent 82de87ce99
commit 2b737c9cc2
4 changed files with 95 additions and 18 deletions

View File

@@ -130,6 +130,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// is actually sent out again
packet.TickCount = 0;
// As with other network applications, assume that an expired packet is
// an indication of some network problem, slow transmission
packet.Client.FlowThrottle.ExpirePackets(1);
expiredPackets.Add(packet);
}
}
@@ -157,6 +161,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
m_packets.Remove(pendingRemove.SequenceNumber);
// As with other network applications, assume that an acknowledged packet is an
// indication that the network can handle a little more load, speed up the transmission
ackedPacket.Client.FlowThrottle.AcknowledgePackets(ackedPacket.Buffer.DataLength);
// Update stats
Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);