diff options
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs | 19 | ||||
-rw-r--r-- | bin/OpenSimDefaults.ini | 8 |
3 files changed, 5 insertions, 31 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index ec51e28..9aa1845 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -312,9 +312,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
312 | /// stack. Use zero to leave this value as the default</summary> | 312 | /// stack. Use zero to leave this value as the default</summary> |
313 | protected int m_recvBufferSize; | 313 | protected int m_recvBufferSize; |
314 | 314 | ||
315 | /// <summary>Flag to process packets asynchronously or synchronously</summary> | ||
316 | protected bool m_asyncPacketHandling; | ||
317 | |||
318 | /// <summary>Tracks whether or not a packet was sent each round so we know | 315 | /// <summary>Tracks whether or not a packet was sent each round so we know |
319 | /// whether or not to sleep</summary> | 316 | /// whether or not to sleep</summary> |
320 | protected bool m_packetSent; | 317 | protected bool m_packetSent; |
@@ -473,7 +470,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
473 | IConfig config = configSource.Configs["ClientStack.LindenUDP"]; | 470 | IConfig config = configSource.Configs["ClientStack.LindenUDP"]; |
474 | if (config != null) | 471 | if (config != null) |
475 | { | 472 | { |
476 | m_asyncPacketHandling = config.GetBoolean("async_packet_handling", true); | ||
477 | m_recvBufferSize = config.GetInt("client_socket_rcvbuf_size", 0); | 473 | m_recvBufferSize = config.GetInt("client_socket_rcvbuf_size", 0); |
478 | sceneThrottleBps = config.GetInt("scene_throttle_max_bps", 0); | 474 | sceneThrottleBps = config.GetInt("scene_throttle_max_bps", 0); |
479 | 475 | ||
@@ -540,10 +536,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
540 | public void StartInbound() | 536 | public void StartInbound() |
541 | { | 537 | { |
542 | m_log.InfoFormat( | 538 | m_log.InfoFormat( |
543 | "[LLUDPSERVER]: Starting inbound packet processing for the LLUDP server in {0} mode with UsePools = {1}", | 539 | "[LLUDPSERVER]: Starting inbound packet processing for the LLUDP server"); |
544 | m_asyncPacketHandling ? "asynchronous" : "synchronous", UsePools); | ||
545 | 540 | ||
546 | base.StartInbound(m_recvBufferSize, m_asyncPacketHandling); | 541 | base.StartInbound(m_recvBufferSize); |
547 | 542 | ||
548 | // This thread will process the packets received that are placed on the packetInbox | 543 | // This thread will process the packets received that are placed on the packetInbox |
549 | WorkManager.StartThread( | 544 | WorkManager.StartThread( |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs index 35a0711..c360f43 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs | |||
@@ -57,9 +57,6 @@ namespace OpenMetaverse | |||
57 | /// <summary>UDP socket, used in either client or server mode</summary> | 57 | /// <summary>UDP socket, used in either client or server mode</summary> |
58 | private Socket m_udpSocket; | 58 | private Socket m_udpSocket; |
59 | 59 | ||
60 | /// <summary>Flag to process packets asynchronously or synchronously</summary> | ||
61 | private bool m_asyncPacketHandling; | ||
62 | |||
63 | /// <summary> | 60 | /// <summary> |
64 | /// Are we to use object pool(s) to reduce memory churn when receiving data? | 61 | /// Are we to use object pool(s) to reduce memory churn when receiving data? |
65 | /// </summary> | 62 | /// </summary> |
@@ -205,10 +202,8 @@ namespace OpenMetaverse | |||
205 | /// manner (not throwing an exception when the remote side resets the | 202 | /// manner (not throwing an exception when the remote side resets the |
206 | /// connection). This call is ignored on Mono where the flag is not | 203 | /// connection). This call is ignored on Mono where the flag is not |
207 | /// necessary</remarks> | 204 | /// necessary</remarks> |
208 | public virtual void StartInbound(int recvBufferSize, bool asyncPacketHandling) | 205 | public virtual void StartInbound(int recvBufferSize) |
209 | { | 206 | { |
210 | m_asyncPacketHandling = asyncPacketHandling; | ||
211 | |||
212 | if (!IsRunningInbound) | 207 | if (!IsRunningInbound) |
213 | { | 208 | { |
214 | m_log.DebugFormat("[UDPBASE]: Starting inbound UDP loop"); | 209 | m_log.DebugFormat("[UDPBASE]: Starting inbound UDP loop"); |
@@ -407,12 +402,7 @@ namespace OpenMetaverse | |||
407 | if (IsRunningInbound) | 402 | if (IsRunningInbound) |
408 | { | 403 | { |
409 | UdpReceives++; | 404 | UdpReceives++; |
410 | 405 | ||
411 | // Asynchronous mode will start another receive before the | ||
412 | // callback for this packet is even fired. Very parallel :-) | ||
413 | if (m_asyncPacketHandling) | ||
414 | AsyncBeginReceive(); | ||
415 | |||
416 | try | 406 | try |
417 | { | 407 | { |
418 | // get the buffer that was created in AsyncBeginReceive | 408 | // get the buffer that was created in AsyncBeginReceive |
@@ -469,10 +459,7 @@ namespace OpenMetaverse | |||
469 | // if (UsePools) | 459 | // if (UsePools) |
470 | // Pool.ReturnObject(buffer); | 460 | // Pool.ReturnObject(buffer); |
471 | 461 | ||
472 | // Synchronous mode waits until the packet callback completes | 462 | AsyncBeginReceive(); |
473 | // before starting the receive to fetch another packet | ||
474 | if (!m_asyncPacketHandling) | ||
475 | AsyncBeginReceive(); | ||
476 | } | 463 | } |
477 | } | 464 | } |
478 | } | 465 | } |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 21ff8d6..83bf9d7 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -649,14 +649,6 @@ | |||
649 | 649 | ||
650 | 650 | ||
651 | [ClientStack.LindenUDP] | 651 | [ClientStack.LindenUDP] |
652 | ; Set this to true to process incoming packets asynchronously. Networking is | ||
653 | ; already separated from packet handling with a queue, so this will only | ||
654 | ; affect whether networking internals such as packet decoding and | ||
655 | ; acknowledgement accounting are done synchronously or asynchronously | ||
656 | ; Default is true. | ||
657 | ; | ||
658 | ;async_packet_handling = true | ||
659 | |||
660 | ; The client socket receive buffer size determines how many | 652 | ; The client socket receive buffer size determines how many |
661 | ; incoming requests we can process; the default on .NET is 8192 | 653 | ; incoming requests we can process; the default on .NET is 8192 |
662 | ; which is about 2 4k-sized UDP datagrams. On mono this is | 654 | ; which is about 2 4k-sized UDP datagrams. On mono this is |