aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs23
1 files changed, 14 insertions, 9 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 74175d0..a6ead5e 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -372,23 +372,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
372 372
373 public void ResendUnacked(LLUDPClient udpClient) 373 public void ResendUnacked(LLUDPClient udpClient)
374 { 374 {
375 if (udpClient.IsConnected && udpClient.NeedAcks.Count > 0) 375 if (!udpClient.IsConnected)
376 return;
377
378 // Disconnect an agent if no packets are received for some time
379 //FIXME: Make 60 an .ini setting
380 if (Environment.TickCount - udpClient.TickLastPacketReceived > 1000 * 60)
376 { 381 {
377 // Disconnect an agent if no packets are received for some time 382 m_log.Warn("[LLUDPSERVER]: Ack timeout, disconnecting " + udpClient.AgentID);
378 //FIXME: Make 60 an .ini setting
379 if (Environment.TickCount - udpClient.TickLastPacketReceived > 1000 * 60)
380 {
381 m_log.Warn("[LLUDPSERVER]: Ack timeout, disconnecting " + udpClient.AgentID);
382 383
383 RemoveClient(udpClient); 384 RemoveClient(udpClient);
384 return; 385 return;
385 } 386 }
386 387
388 if (udpClient.NeedAcks.Count > 0)
389 {
387 // Get a list of all of the packets that have been sitting unacked longer than udpClient.RTO 390 // Get a list of all of the packets that have been sitting unacked longer than udpClient.RTO
388 List<OutgoingPacket> expiredPackets = udpClient.NeedAcks.GetExpiredPackets(udpClient.RTO); 391 List<OutgoingPacket> expiredPackets = udpClient.NeedAcks.GetExpiredPackets(udpClient.RTO);
389 392
390 if (expiredPackets != null) 393 if (expiredPackets != null)
391 { 394 {
395 m_log.Debug("[LLUDPSERVER]: Resending " + expiredPackets.Count + " packets to " + udpClient.AgentID);
396
392 // Resend packets 397 // Resend packets
393 for (int i = 0; i < expiredPackets.Count; i++) 398 for (int i = 0; i < expiredPackets.Count; i++)
394 { 399 {