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.cs27
1 files changed, 24 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index c773c05..98bb4f7 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -399,6 +399,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
399 #region Queue or Send 399 #region Queue or Send
400 400
401 OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category); 401 OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category);
402 outgoingPacket.Type = type;
402 403
403 if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket)) 404 if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket))
404 SendPacketFinal(outgoingPacket); 405 SendPacketFinal(outgoingPacket);
@@ -510,6 +511,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
510 byte flags = buffer.Data[0]; 511 byte flags = buffer.Data[0];
511 bool isResend = (flags & Helpers.MSG_RESENT) != 0; 512 bool isResend = (flags & Helpers.MSG_RESENT) != 0;
512 bool isReliable = (flags & Helpers.MSG_RELIABLE) != 0; 513 bool isReliable = (flags & Helpers.MSG_RELIABLE) != 0;
514 bool sendSynchronous = false;
513 LLUDPClient udpClient = outgoingPacket.Client; 515 LLUDPClient udpClient = outgoingPacket.Client;
514 516
515 if (!udpClient.IsConnected) 517 if (!udpClient.IsConnected)
@@ -565,9 +567,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
565 if (isReliable) 567 if (isReliable)
566 Interlocked.Add(ref udpClient.UnackedBytes, outgoingPacket.Buffer.DataLength); 568 Interlocked.Add(ref udpClient.UnackedBytes, outgoingPacket.Buffer.DataLength);
567 569
568 // Put the UDP payload on the wire 570 //Some packet types need to be sent synchonously.
569 AsyncBeginSend(buffer); 571 //Sorry, i know it's not optimal, but until the LL client
572 //manages packets correctly and re-orders them as required, this is necessary.
570 573
574
575 // Put the UDP payload on the wire
576 if (outgoingPacket.Type == PacketType.ImprovedTerseObjectUpdate)
577 {
578 SyncBeginPrioritySend(buffer, 2); // highest priority
579 }
580 else if (outgoingPacket.Type == PacketType.ObjectUpdate
581 || outgoingPacket.Type == PacketType.LayerData)
582 {
583 SyncBeginPrioritySend(buffer, 1); // medium priority
584 }
585 else
586 {
587 SyncBeginPrioritySend(buffer, 0); // normal priority
588 }
589
590 //AsyncBeginSend(buffer);
591
571 // Keep track of when this packet was sent out (right now) 592 // Keep track of when this packet was sent out (right now)
572 outgoingPacket.TickCount = Environment.TickCount & Int32.MaxValue; 593 outgoingPacket.TickCount = Environment.TickCount & Int32.MaxValue;
573 } 594 }
@@ -842,7 +863,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
842 863
843 Buffer.BlockCopy(packetData, 0, buffer.Data, 0, length); 864 Buffer.BlockCopy(packetData, 0, buffer.Data, 0, length);
844 865
845 AsyncBeginSend(buffer); 866 SyncBeginPrioritySend(buffer, 1); //Setting this to a medium priority should help minimise resends
846 } 867 }
847 868
848 private bool IsClientAuthorized(UseCircuitCodePacket useCircuitCode, out AuthenticateResponse sessionInfo) 869 private bool IsClientAuthorized(UseCircuitCodePacket useCircuitCode, out AuthenticateResponse sessionInfo)