aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Send KillPackets on the Task queue rather than the State queueJustin Clark-Casey (justincc)2010-09-171-1/+7
| | | | | | | | | Object updates are sent on the task queue. It's possible for an object update to be placed on the client queue before a kill packet comes along. The kill packet would then be placed on the state queue and possibly get sent before the update If the update gets sent afterwards then client get undeletable no owner objects until relog Placing the kills in the task queue should mean that they are received after updates. The kill record prevents subsequent updates getting on the queue Comments state that updates are sent via the state queue but this isn't true. If this was the case this problem might not exist.
* * Cache packed throttle data to avoid repeated allocations in ↵John Hurliman2010-03-051-11/+24
| | | | | | CheckForSignificantMovement() * Removed a lock on "return m_neighbours.Count" in GetInaccurateNeighborCount(). Dictionary<>.Count by itself does not benefit from locking
* * Fix Inconsistent line ending style in LLUDPClientTeravus Ovares (Dan Olivares)2009-12-011-2/+2
|
* * Patch from Misterblue to fix Environment.TickCount for statistics ↵Teravus Ovares (Dan Olivares)2009-11-291-1/+4
| | | | | | purposes. Resolves the wrap-around of the 32 bit uint. * Teravus moved the Environment methods to the Util class
* Make the default and max RTO configurable int he linden client stackMelanie2009-10-301-4/+12
|
* * Moving parcel media and avatar update packets from the unthrottled ↵John Hurliman2009-10-301-3/+0
| | | | | | | category to task * Fixing a bug where the max burst rate for the state category was being set as unlimited, causing connections to child agents to saturate bandwidth * Upped the example default drip rates to 1000 bytes/sec, the minimum granularity for the token buckets
* * Converts ClientManager.ForEach() (and as a result, Scene.ForEachClient()) ↵John Hurliman2009-10-271-1/+1
| | | | | | to use a non-blocking parallel method when operating in async mode * Minor code readability cleanup
* Removed an unnecessary lock in LLUDPClient.UpdateRTO() and ↵John Hurliman2009-10-261-30/+21
| | | | LLUDPClient.BackoffRTO()
* Changing Scene.ForEachClient to use the synchronous for loop instead of ↵John Hurliman2009-10-251-14/+40
| | | | | | | | | | Parallel. This is quite possibly the source of some deadlocking, and at the very least the synchronous version gives better stack traces * Lock the LLUDPClient RTO math * Add a helper function for backing off the RTO, and follow the optional advice in RFC 2988 to clear existing SRTT and RTTVAR values during a backoff * Removing the unused PrimitiveBaseShape.SculptImage parameter * Improved performance of SceneObjectPart instantiation * ZeroMesher now drops SculptData bytes like Meshmerizer, to allow the texture data to be GCed * Improved typecasting speed in MySQLLegacyRegionData.BuildShape() * Improved the instantiation of PrimitiveBaseShape
* * Changed the max RTO value to 60 seconds to comply with RFC 2988John Hurliman2009-10-231-1/+1
| | | | * Implemented section 5.5, exponential backoff of the RTO after a resend
* Commented out noisy debugging about resent packets (normal) and agents ↵John Hurliman2009-10-231-2/+2
| | | | setting throttles (normal)
* * Change the OnQueueEmpty signature to send the flags of the queues that are ↵John Hurliman2009-10-211-33/+77
| | | | | | | empty instead of firing once per empty queue * Change the OnQueueEmpty firing to use a minimum time until next fire instead of a sleep * Set OutgoingPacket.TickCount = 0 earlier to avoid extra resends when things are running slowly (inside a profiler, for example)
* * Clarified what FireQueueEmpty is doing with a MIN_CALLBACK_MS constant and ↵John Hurliman2009-10-211-4/+7
| | | | | | | upped it to 30ms * Removed the unused PacketSent() function * Switched UnackedPacketCollection from a SortedDictionary to a Dictionary now that the sorting is no longer needed. Big performance improvement for ResendUnacked()
* * FireQueueEmpty now checks if a measurable amount of time has passed, and ↵John Hurliman2009-10-211-2/+6
| | | | | | if not it sleeps for a small amount of time. This throttles OnQueueEmpty calls where there is no callback or the callback is doing very little work * Changed HandleQueueEmpty()'s Monitor.TryEnter() calls to locks. We want to take our time in this function and do all the work necessary, since returning too fast will induce a sleep anyways
* * Changed the timing calculations for sending resends/acks/pings from ↵John Hurliman2009-10-211-12/+1
| | | | | | per-client back to per-scene * Testing a fix from Jim to make the cpu usage fix cleaner
* Testing out a hack to identify the source of the high cpu usageJohn Hurliman2009-10-211-0/+3
|
* * Handle UseCircuitCode packets asynchronously. Adding an agent to a scene ↵John Hurliman2009-10-211-2/+5
| | | | | | | | can take several seconds, and was blocking up packet handling in the meantime * Clamp retransmission timeout values between three and 10 seconds * Log outgoing time for a packet right after it is sent instead of well before * Loop through the entire UnackedPacketCollection when looking for expired packets
* * Replaced the UnackedPacketCollection with a lockless implementation. The ↵John Hurliman2009-10-211-25/+8
| | | | | | | tiny amount of time spent in the locks turned into a lot of time when the rest of the LLUDP implementation went lockless * Changed the timer tracking numbers for each client to not have "memory". It will no longer queue up calls to functions like ResendUnacked * Reverted Jim's WaitHandle code. Although it was technically more correct, it exhibited the exact same behavior as the old code but spent more cycles. The 20ms has been replaced with the minimum amount of time before a token bucket could receive a drip, and an else { sleep(0); } was added to make sure the outgoing packet handler always yields at least a minimum amount
* Fixed the way OnQueueEmpty is called to prevent simultaneous calls for the ↵John Hurliman2009-10-211-7/+7
| | | | same category
* Committing Jim's optimization to replace the 20ms sleep in outgoing packet ↵John Hurliman2009-10-211-16/+35
| | | | handling with an interruptible wait handle
* * Added a sanity check to GetScriptAssemblies() and GetScriptStates() for ↵John Hurliman2009-10-201-0/+2
| | | | | | the case where no scripting engine is enabled * Added TokenBucket.cs to OpenSim, with some fixes for setting a more accurate MaxBurst value and getting a more accurate Content value (by Drip()ing each get)
* * Removed the unused m_agentUpdates collection and some extra work that was ↵John Hurliman2009-10-201-1/+1
| | | | | | being done for AgentUpdate packets * Start LLUDPClients unpaused (this variable is not being used yet)
* * Removed the throttle speed optimizations to see if it brings stability backJohn Hurliman2009-10-201-9/+16
| | | | * Changed the outgoing packet handler to use a real function instead of a closure and to track time on a per-client basis instead of a global basis
* Reverting the deletion of files related to texture sending until we figure ↵John Hurliman2009-10-201-0/+2
| | | | out exactly what is and isn't needed
* * Change Util.FireAndForget to use ThreadPool.UnsafeQueueUserWorkItem(). ↵John Hurliman2009-10-191-2/+7
| | | | | | | | | | | | | | This avoids .NET remoting and a managed->unmanaged->managed jump. Overall, a night and day performance difference * Initialize the LLClientView prim full update queue to the number of prims in the scene for a big performance boost * Reordered some comparisons on hot code paths for a minor speed boost * Removed an unnecessary call to the expensive DateTime.Now function (if you *have* to get the current time as opposed to Environment.TickCount, always use DateTime.UtcNow) * Don't fire the queue empty callback for the Resend category * Run the outgoing packet handler thread loop for each client synchronously. It seems like more time was being spent doing the execution asynchronously, and it made deadlocks very difficult to track down * Rewrote some expensive math in LandObject.cs * Optimized EntityManager to only lock on operations that need locking, and use TryGetValue() where possible * Only update the attachment database when an object is attached or detached * Other small misc. performance improvements
* * Simplified the prioritization packet creation code to reduce CPU usage and ↵John Hurliman2009-10-161-8/+12
| | | | | | increase throughput. Apologies to Jim for hacking on your code while it's only halfway done, I'll take responsibility for the manual merge * Changed LLUDP to use its own MTU value of 1400 instead of the 1200 value pulled from the currently shipped libomv
* * Change appearance packets from State to Task. This will hopefully fix the ↵John Hurliman2009-10-161-35/+44
| | | | | | cloud issues * Changed the throttling logic to obey the requested client bandwidth limit but also share bandwidth between some of the categories to improve throughput on high prim or heavily trafficked regions
* * Clean up the SetThrottle() code and add a maxBurstRate parameter to allow ↵John Hurliman2009-10-141-94/+94
| | | | more tweaking in the future
* * Minimized the number of times textures are pulled off the priority queueJohn Hurliman2009-10-141-13/+52
| | | | | | * 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
* * Split Task category into Task and StateJohn Hurliman2009-10-131-24/+38
| | | | * Crude prioritization hack
* * Copied LocklessQueue.cs into OpenSim.Framework and added the .Count ↵John Hurliman2009-10-131-9/+41
| | | | | | | | | property and .Clear() method * Changed the way the QueueEmpty callback is fired. It will be fired asynchronously as soon as an empty queue is detected (this can happen immediately following a dequeue), and will not be fired again until at least one packet is dequeued from that queue. This will give callbacks advanced notice of an empty queue and prevent callbacks from stacking up while the queue is empty * Added LLUDPClient.IsConnected checks in several places to prevent unwanted network activity after a client disconnects * Prevent LLClientView.Close() from being called twice every disconnect * Removed the packet resend limit and improved the client timeout check
* * Rewrote ClientManager to remove Lindenisms from OpenSim core, improve ↵John Hurliman2009-10-131-1/+0
| | | | | | | | performance by removing locks, and replace LLUDPClientCollection * Removed the confusing (and LL-specific) shutdowncircuit parameter from IClientAPI.Close() * Updated the LLUDP code to only use ClientManager instead of trying to synchronize ClientManager and m_clients * Remove clients asynchronously since it is a very slow operation (including a 2000ms sleep)
* * Broke the circular reference between LLClientView and LLUDPClient. This ↵John Hurliman2009-10-131-2/+0
| | | | | | should speed up garbage collection on the large LLClientView objects, and also prevents handling packets for disconnected clients * Renamed local LLUDPClient variables to udpClient to avoid naming confusion between LLUDPClient and LLClientView
* * Added missing references to prebuild.xml and commented out the LindenUDP ↵John Hurliman2009-10-061-2/+54
| | | | | | | | tests until a new test harness is written * Clients are no longer disconnected when a packet handler crashes. We'll see how this works out in practice * Added documentation and cleanup, getting ready for the first public push * Deleted an old LLUDP file
* * Try/catch around EndInvoke() when Util.FireAndForget() returns to catch ↵John Hurliman2009-10-061-10/+30
| | | | | | | exceptions thrown in the async method * Added packet stats handling to the new LLUDP implementation * Attempting to avoid a race condition when creating a new LLUDPClient
* * Continued work on the new LLUDP implementation. Appears to be functioning, ↵John Hurliman2009-10-061-0/+370
although not everything is reimplemented yet * Replaced logic in ThreadTracker with a call to System.Diagnostics that does the same thing * Added Util.StringToBytes256() and Util.StringToBytes1024() to clamp output at byte[256] and byte[1024], respectively * Fixed formatting for a MySQLAssetData error logging line