diff options
author | Melanie | 2009-10-02 04:04:14 +0100 |
---|---|---|
committer | Melanie | 2009-10-02 04:04:14 +0100 |
commit | 18a744cac10c797b67236988a84ab6d13a5543b8 (patch) | |
tree | 8333647698a7933ed6def48488380c72084f8360 /OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |
parent | Removing console debug spew (diff) | |
download | opensim-SC_OLD-18a744cac10c797b67236988a84ab6d13a5543b8.zip opensim-SC_OLD-18a744cac10c797b67236988a84ab6d13a5543b8.tar.gz opensim-SC_OLD-18a744cac10c797b67236988a84ab6d13a5543b8.tar.bz2 opensim-SC_OLD-18a744cac10c797b67236988a84ab6d13a5543b8.tar.xz |
Change texture sending to be driven by the queue empty event from the
packet queue, rather than a timer
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 71 |
1 files changed, 17 insertions, 54 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 460f94e..23fa1a3 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -81,8 +81,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
81 | private List<ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates = | 81 | private List<ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates = |
82 | new List<ObjectUpdatePacket.ObjectDataBlock>(); | 82 | new List<ObjectUpdatePacket.ObjectDataBlock>(); |
83 | 83 | ||
84 | private Timer m_textureRequestTimer; | ||
85 | |||
86 | private bool m_clientBlocked; | 84 | private bool m_clientBlocked; |
87 | 85 | ||
88 | private int m_probesWithNoIngressPackets; | 86 | private int m_probesWithNoIngressPackets; |
@@ -143,9 +141,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
143 | protected int m_primTerseUpdateRate = 10; | 141 | protected int m_primTerseUpdateRate = 10; |
144 | protected int m_primFullUpdateRate = 14; | 142 | protected int m_primFullUpdateRate = 14; |
145 | 143 | ||
146 | protected int m_textureRequestRate = 100; | 144 | protected int m_textureSendLimit = 100; |
147 | protected int m_textureSendLimit = 10; | 145 | protected int m_textureDataLimit = 10; |
148 | protected int m_textureDataLimit = 5; | ||
149 | 146 | ||
150 | protected int m_packetMTU = 1400; | 147 | protected int m_packetMTU = 1400; |
151 | 148 | ||
@@ -534,6 +531,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
534 | m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings); | 531 | m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings); |
535 | m_PacketHandler.SynchronizeClient = SynchronizeClient; | 532 | m_PacketHandler.SynchronizeClient = SynchronizeClient; |
536 | m_PacketHandler.OnPacketStats += PopulateStats; | 533 | m_PacketHandler.OnPacketStats += PopulateStats; |
534 | m_PacketHandler.OnQueueEmpty += HandleQueueEmpty; | ||
537 | 535 | ||
538 | if (scene.Config != null) | 536 | if (scene.Config != null) |
539 | { | 537 | { |
@@ -555,9 +553,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
555 | m_primFullUpdateRate = clientConfig.GetInt("FullUpdateRate", | 553 | m_primFullUpdateRate = clientConfig.GetInt("FullUpdateRate", |
556 | m_primFullUpdateRate); | 554 | m_primFullUpdateRate); |
557 | 555 | ||
558 | m_textureRequestRate = clientConfig.GetInt("TextureRequestRate", | ||
559 | m_textureRequestRate); | ||
560 | |||
561 | m_textureSendLimit = clientConfig.GetInt("TextureSendLimit", | 556 | m_textureSendLimit = clientConfig.GetInt("TextureSendLimit", |
562 | m_textureSendLimit); | 557 | m_textureSendLimit); |
563 | 558 | ||
@@ -607,9 +602,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
607 | if (m_primFullUpdateTimer.Enabled) | 602 | if (m_primFullUpdateTimer.Enabled) |
608 | lock (m_primFullUpdateTimer) | 603 | lock (m_primFullUpdateTimer) |
609 | m_primFullUpdateTimer.Stop(); | 604 | m_primFullUpdateTimer.Stop(); |
610 | if (m_textureRequestTimer.Enabled) | ||
611 | lock (m_textureRequestTimer) | ||
612 | m_textureRequestTimer.Stop(); | ||
613 | 605 | ||
614 | // This is just to give the client a reasonable chance of | 606 | // This is just to give the client a reasonable chance of |
615 | // flushing out all it's packets. There should probably | 607 | // flushing out all it's packets. There should probably |
@@ -706,10 +698,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
706 | if (m_primFullUpdateTimer.Enabled) | 698 | if (m_primFullUpdateTimer.Enabled) |
707 | lock (m_primFullUpdateTimer) | 699 | lock (m_primFullUpdateTimer) |
708 | m_primFullUpdateTimer.Stop(); | 700 | m_primFullUpdateTimer.Stop(); |
709 | |||
710 | if (m_textureRequestTimer.Enabled) | ||
711 | lock (m_textureRequestTimer) | ||
712 | m_textureRequestTimer.Stop(); | ||
713 | } | 701 | } |
714 | 702 | ||
715 | public void Restart() | 703 | public void Restart() |
@@ -732,11 +720,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
732 | m_primFullUpdateTimer = new Timer(m_primFullUpdateRate); | 720 | m_primFullUpdateTimer = new Timer(m_primFullUpdateRate); |
733 | m_primFullUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessPrimFullUpdates); | 721 | m_primFullUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessPrimFullUpdates); |
734 | m_primFullUpdateTimer.AutoReset = false; | 722 | m_primFullUpdateTimer.AutoReset = false; |
735 | |||
736 | m_textureRequestTimer = new Timer(m_textureRequestRate); | ||
737 | m_textureRequestTimer.Elapsed += new ElapsedEventHandler(ProcessTextureRequests); | ||
738 | m_textureRequestTimer.AutoReset = false; | ||
739 | |||
740 | } | 723 | } |
741 | 724 | ||
742 | private void Terminate() | 725 | private void Terminate() |
@@ -747,7 +730,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
747 | m_avatarTerseUpdateTimer.Close(); | 730 | m_avatarTerseUpdateTimer.Close(); |
748 | m_primTerseUpdateTimer.Close(); | 731 | m_primTerseUpdateTimer.Close(); |
749 | m_primFullUpdateTimer.Close(); | 732 | m_primFullUpdateTimer.Close(); |
750 | m_textureRequestTimer.Close(); | ||
751 | 733 | ||
752 | m_PacketHandler.OnPacketStats -= PopulateStats; | 734 | m_PacketHandler.OnPacketStats -= PopulateStats; |
753 | m_PacketHandler.Dispose(); | 735 | m_PacketHandler.Dispose(); |
@@ -982,10 +964,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
982 | m_primFullUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessPrimFullUpdates); | 964 | m_primFullUpdateTimer.Elapsed += new ElapsedEventHandler(ProcessPrimFullUpdates); |
983 | m_primFullUpdateTimer.AutoReset = false; | 965 | m_primFullUpdateTimer.AutoReset = false; |
984 | 966 | ||
985 | m_textureRequestTimer = new Timer(m_textureRequestRate); | ||
986 | m_textureRequestTimer.Elapsed += new ElapsedEventHandler(ProcessTextureRequests); | ||
987 | m_textureRequestTimer.AutoReset = false; | ||
988 | |||
989 | m_scene.AddNewClient(this); | 967 | m_scene.AddNewClient(this); |
990 | 968 | ||
991 | RefreshGroupMembership(); | 969 | RefreshGroupMembership(); |
@@ -1057,26 +1035,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1057 | } | 1035 | } |
1058 | } | 1036 | } |
1059 | 1037 | ||
1060 | protected virtual void TextureRequestHandler() | ||
1061 | { | ||
1062 | m_log.DebugFormat("[TRH] Thread started"); | ||
1063 | while (m_imageManager != null) | ||
1064 | { | ||
1065 | try | ||
1066 | { | ||
1067 | while (m_imageManager != null) | ||
1068 | { | ||
1069 | } | ||
1070 | } | ||
1071 | catch (Exception e) | ||
1072 | { | ||
1073 | m_log.WarnFormat("[TRH] Exception in handler loop: {0}", e.Message); | ||
1074 | m_log.Debug(e); | ||
1075 | } | ||
1076 | } | ||
1077 | m_log.DebugFormat("[TRH] Thread terminated"); | ||
1078 | } | ||
1079 | |||
1080 | # endregion | 1038 | # endregion |
1081 | 1039 | ||
1082 | // Previously ClientView.API partial class | 1040 | // Previously ClientView.API partial class |
@@ -3176,16 +3134,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3176 | // Unlike the other timers, this one is only started after | 3134 | // Unlike the other timers, this one is only started after |
3177 | // the first request is seen. | 3135 | // the first request is seen. |
3178 | 3136 | ||
3179 | void ProcessTextureRequests(object sender, ElapsedEventArgs e) | 3137 | void HandleQueueEmpty(ThrottleOutPacketType queue) |
3138 | { | ||
3139 | switch (queue) | ||
3140 | { | ||
3141 | case ThrottleOutPacketType.Texture: | ||
3142 | m_log.Debug("Texture queue empty"); | ||
3143 | ProcessTextureRequests(); | ||
3144 | break; | ||
3145 | } | ||
3146 | } | ||
3147 | |||
3148 | void ProcessTextureRequests() | ||
3180 | { | 3149 | { |
3181 | if (m_imageManager != null) | 3150 | if (m_imageManager != null) |
3182 | { | 3151 | { |
3183 | if (m_imageManager.ProcessImageQueue(m_textureSendLimit, | 3152 | m_imageManager.ProcessImageQueue(m_textureSendLimit, |
3184 | m_textureDataLimit)) | 3153 | m_textureDataLimit); |
3185 | { | ||
3186 | lock (m_textureRequestTimer) | ||
3187 | m_textureRequestTimer.Start(); | ||
3188 | } | ||
3189 | } | 3154 | } |
3190 | } | 3155 | } |
3191 | 3156 | ||
@@ -6638,8 +6603,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6638 | if (m_imageManager != null) | 6603 | if (m_imageManager != null) |
6639 | { | 6604 | { |
6640 | m_imageManager.EnqueueReq(args); | 6605 | m_imageManager.EnqueueReq(args); |
6641 | lock (m_textureRequestTimer) | ||
6642 | m_textureRequestTimer.Start(); | ||
6643 | } | 6606 | } |
6644 | } | 6607 | } |
6645 | } | 6608 | } |