aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.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/OpenSimUDPBase.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/OpenSimUDPBase.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs15
1 files changed, 13 insertions, 2 deletions
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
73 /// </summary> 73 /// </summary>
74 /// <param name="bindAddress">Local IP address to bind the server to</param> 74 /// <param name="bindAddress">Local IP address to bind the server to</param>
75 /// <param name="port">Port to listening for incoming UDP packets on</param> 75 /// <param name="port">Port to listening for incoming UDP packets on</param>
76 ///
76 public OpenSimUDPBase(IPAddress bindAddress, int port) 77 public OpenSimUDPBase(IPAddress bindAddress, int port)
77 { 78 {
78 m_localBindAddress = bindAddress; 79 m_localBindAddress = bindAddress;
@@ -82,25 +83,31 @@ namespace OpenMetaverse
82 /// <summary> 83 /// <summary>
83 /// Start the UDP server 84 /// Start the UDP server
84 /// </summary> 85 /// </summary>
86 /// <param name="recvBufferSize">The size of the receive buffer for
87 /// the UDP socket. This value is passed up to the operating system
88 /// and used in the system networking stack. Use zero to leave this
89 /// value as the default</param>
85 /// <remarks>This method will attempt to set the SIO_UDP_CONNRESET flag 90 /// <remarks>This method will attempt to set the SIO_UDP_CONNRESET flag
86 /// on the socket to get newer versions of Windows to behave in a sane 91 /// on the socket to get newer versions of Windows to behave in a sane
87 /// manner (not throwing an exception when the remote side resets the 92 /// manner (not throwing an exception when the remote side resets the
88 /// connection). This call is ignored on Mono where the flag is not 93 /// connection). This call is ignored on Mono where the flag is not
89 /// necessary</remarks> 94 /// necessary</remarks>
90 public void Start() 95 public void Start(int recvBufferSize)
91 { 96 {
92 if (m_shutdownFlag) 97 if (m_shutdownFlag)
93 { 98 {
94 const int SIO_UDP_CONNRESET = -1744830452; 99 const int SIO_UDP_CONNRESET = -1744830452;
95 100
96 IPEndPoint ipep = new IPEndPoint(m_localBindAddress, m_udpPort); 101 IPEndPoint ipep = new IPEndPoint(m_localBindAddress, m_udpPort);
102
97 m_udpSocket = new Socket( 103 m_udpSocket = new Socket(
98 AddressFamily.InterNetwork, 104 AddressFamily.InterNetwork,
99 SocketType.Dgram, 105 SocketType.Dgram,
100 ProtocolType.Udp); 106 ProtocolType.Udp);
107
101 try 108 try
102 { 109 {
103 // this udp socket flag is not supported under mono, 110 // This udp socket flag is not supported under mono,
104 // so we'll catch the exception and continue 111 // so we'll catch the exception and continue
105 m_udpSocket.IOControl(SIO_UDP_CONNRESET, new byte[] { 0 }, null); 112 m_udpSocket.IOControl(SIO_UDP_CONNRESET, new byte[] { 0 }, null);
106 m_log.Debug("[UDPBASE]: SIO_UDP_CONNRESET flag set"); 113 m_log.Debug("[UDPBASE]: SIO_UDP_CONNRESET flag set");
@@ -109,6 +116,10 @@ namespace OpenMetaverse
109 { 116 {
110 m_log.Debug("[UDPBASE]: SIO_UDP_CONNRESET flag not supported on this platform, ignoring"); 117 m_log.Debug("[UDPBASE]: SIO_UDP_CONNRESET flag not supported on this platform, ignoring");
111 } 118 }
119
120 if (recvBufferSize != 0)
121 m_udpSocket.ReceiveBufferSize = recvBufferSize;
122
112 m_udpSocket.Bind(ipep); 123 m_udpSocket.Bind(ipep);
113 124
114 // we're not shutting down, we're starting up 125 // we're not shutting down, we're starting up