aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-14 11:43:31 -0700
committerJohn Hurliman2009-10-14 11:43:31 -0700
commit0d2e6463d714bce8a6a628bd647c625feeeae8f6 (patch)
tree1d4a805e65932c225a4c6a2b219b23840b3288a9 /OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
parent* Split Task category into Task and State (diff)
downloadopensim-SC_OLD-0d2e6463d714bce8a6a628bd647c625feeeae8f6.zip
opensim-SC_OLD-0d2e6463d714bce8a6a628bd647c625feeeae8f6.tar.gz
opensim-SC_OLD-0d2e6463d714bce8a6a628bd647c625feeeae8f6.tar.bz2
opensim-SC_OLD-0d2e6463d714bce8a6a628bd647c625feeeae8f6.tar.xz
* Minimized the number of times textures are pulled off the priority queue
* OnQueueEmpty is still called async, but will not be called for a given category if the previous callback for that category is still running. This is the most balanced behavior I could find, and seems to work well * Added support for the old [ClientStack.LindenUDP] settings (including setting the receive buffer size) and added the new token bucket and global throttle settings * Added the AssetLoaderEnabled config variable to optionally disable loading assets from XML every startup. This gives a dramatic improvement in startup times for those who don't need the functionality every startup
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs25
1 files changed, 14 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
index 5877779..9ded390 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
@@ -72,14 +72,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
72 m_imageManager = imageManager; 72 m_imageManager = imageManager;
73 } 73 }
74 74
75 public bool SendPackets(LLClientView client, int maxpack) 75 /// <summary>
76 /// Sends packets for this texture to a client until packetsToSend is
77 /// hit or the transfer completes
78 /// </summary>
79 /// <param name="client">Reference to the client that the packets are destined for</param>
80 /// <param name="packetsToSend">Maximum number of packets to send during this call</param>
81 /// <param name="packetsSent">Number of packets sent during this call</param>
82 /// <returns>True if the transfer completes at the current discard level, otherwise false</returns>
83 public bool SendPackets(LLClientView client, int packetsToSend, out int packetsSent)
76 { 84 {
77 if (client == null) 85 packetsSent = 0;
78 return false;
79 86
80 if (m_currentPacket <= m_stopPacket) 87 if (m_currentPacket <= m_stopPacket)
81 { 88 {
82 int count = 0;
83 bool sendMore = true; 89 bool sendMore = true;
84 90
85 if (!m_sentInfo || (m_currentPacket == 0)) 91 if (!m_sentInfo || (m_currentPacket == 0))
@@ -88,25 +94,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
88 94
89 m_sentInfo = true; 95 m_sentInfo = true;
90 ++m_currentPacket; 96 ++m_currentPacket;
91 ++count; 97 ++packetsSent;
92 } 98 }
93 if (m_currentPacket < 2) 99 if (m_currentPacket < 2)
94 { 100 {
95 m_currentPacket = 2; 101 m_currentPacket = 2;
96 } 102 }
97 103
98 while (sendMore && count < maxpack && m_currentPacket <= m_stopPacket) 104 while (sendMore && packetsSent < packetsToSend && m_currentPacket <= m_stopPacket)
99 { 105 {
100 sendMore = SendPacket(client); 106 sendMore = SendPacket(client);
101 ++m_currentPacket; 107 ++m_currentPacket;
102 ++count; 108 ++packetsSent;
103 } 109 }
104
105 if (m_currentPacket > m_stopPacket)
106 return true;
107 } 110 }
108 111
109 return false; 112 return (m_currentPacket > m_stopPacket);
110 } 113 }
111 114
112 public void RunUpdate() 115 public void RunUpdate()