From 0d2e6463d714bce8a6a628bd647c625feeeae8f6 Mon Sep 17 00:00:00 2001
From: John Hurliman
Date: Wed, 14 Oct 2009 11:43:31 -0700
Subject: * 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
---
OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs
index fad2ea8..44a6ed6 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs
@@ -73,6 +73,7 @@ namespace OpenMetaverse
///
/// Local IP address to bind the server to
/// Port to listening for incoming UDP packets on
+ ///
public OpenSimUDPBase(IPAddress bindAddress, int port)
{
m_localBindAddress = bindAddress;
@@ -82,25 +83,31 @@ namespace OpenMetaverse
///
/// Start the UDP server
///
+ /// The size of the receive buffer for
+ /// the UDP socket. This value is passed up to the operating system
+ /// and used in the system networking stack. Use zero to leave this
+ /// value as the default
/// This method will attempt to set the SIO_UDP_CONNRESET flag
/// on the socket to get newer versions of Windows to behave in a sane
/// manner (not throwing an exception when the remote side resets the
/// connection). This call is ignored on Mono where the flag is not
/// necessary
- public void Start()
+ public void Start(int recvBufferSize)
{
if (m_shutdownFlag)
{
const int SIO_UDP_CONNRESET = -1744830452;
IPEndPoint ipep = new IPEndPoint(m_localBindAddress, m_udpPort);
+
m_udpSocket = new Socket(
AddressFamily.InterNetwork,
SocketType.Dgram,
ProtocolType.Udp);
+
try
{
- // this udp socket flag is not supported under mono,
+ // This udp socket flag is not supported under mono,
// so we'll catch the exception and continue
m_udpSocket.IOControl(SIO_UDP_CONNRESET, new byte[] { 0 }, null);
m_log.Debug("[UDPBASE]: SIO_UDP_CONNRESET flag set");
@@ -109,6 +116,10 @@ namespace OpenMetaverse
{
m_log.Debug("[UDPBASE]: SIO_UDP_CONNRESET flag not supported on this platform, ignoring");
}
+
+ if (recvBufferSize != 0)
+ m_udpSocket.ReceiveBufferSize = recvBufferSize;
+
m_udpSocket.Bind(ipep);
// we're not shutting down, we're starting up
--
cgit v1.1