From 8c41271b3312f2a02608ffc41b220f7fb018d6ad Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 13 Oct 2014 13:17:48 +0100 Subject: *TEST* send udp sync. Stop uncontroled and hidden use of IO threads. Testing this may require several people. --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 3 ++- .../Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 99e7aba..ac4a877 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1305,7 +1305,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP PacketsSentCount++; // Put the UDP payload on the wire - AsyncBeginSend(buffer); + //AsyncBeginSend(buffer); + SyncSend(buffer); // Keep track of when this packet was sent out (right now) outgoingPacket.TickCount = Environment.TickCount & Int32.MaxValue; diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs index 881e768..1d76c14 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs @@ -375,12 +375,28 @@ namespace OpenMetaverse // Synchronous mode waits until the packet callback completes // before starting the receive to fetch another packet - if (!m_asyncPacketHandling) +// if (!m_asyncPacketHandling) AsyncBeginReceive(); } } } + public void SyncSend(UDPPacketBuffer buf) + { + try + { + m_udpSocket.SendTo( + buf.Data, + 0, + buf.DataLength, + SocketFlags.None, + buf.RemoteEndPoint + ); + } + catch (SocketException) { } + catch (ObjectDisposedException) { } + } + public void AsyncBeginSend(UDPPacketBuffer buf) { // if (IsRunningOutbound) -- cgit v1.1