From c29df824c2db40ccdfbaf7ac6f166c578d77db3a Mon Sep 17 00:00:00 2001 From: MW Date: Sat, 8 Sep 2007 07:50:31 +0000 Subject: Converted the LSL scripting engine into a IRegionModule, so now all "modules" share a common base interface and are loaded from the single loader. (It seems to work fine, but I have left the old scriptengine loader, incase we have to change back). Removed the reference to OpenJpeg in the DynamicTextureModule, to see if that was causing the build problem someone is having. Added a Temporary fix for the "existing connection was forcibly closed by the remote host" exception on windows when a user logs out of a multiregion instance. Some early work to prepare for improving the way clients are updated (about prims etc). --- OpenSim/Region/ClientStack/ClientView.cs | 8 ++++++++ OpenSim/Region/ClientStack/ClientViewBase.cs | 4 ++++ OpenSim/Region/ClientStack/PacketServer.cs | 8 ++++++++ OpenSim/Region/ClientStack/UDPServer.cs | 18 +++++++++++++++++- 4 files changed, 37 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index ff527fb..52fc568 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -128,6 +128,14 @@ namespace OpenSim.Region.ClientStack m_networkServer.RemoveClientCircuit(this.CircuitCode); this.ClientThread.Abort(); } + + public override void ConnectionClosed() + { + clientPingTimer.Stop(); + m_clientThreads.Remove(this.CircuitCode); + m_networkServer.RemoveClientCircuit(this.CircuitCode); + this.ClientThread.Abort(); + } #endregion # region Packet Handling diff --git a/OpenSim/Region/ClientStack/ClientViewBase.cs b/OpenSim/Region/ClientStack/ClientViewBase.cs index 0b2c875..8a7c764 100644 --- a/OpenSim/Region/ClientStack/ClientViewBase.cs +++ b/OpenSim/Region/ClientStack/ClientViewBase.cs @@ -315,6 +315,10 @@ namespace OpenSim.Region.ClientStack } + public virtual void ConnectionClosed() + { + } + #region Nested Classes public class QueItem diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs index 66a7ffd..59f11d5 100644 --- a/OpenSim/Region/ClientStack/PacketServer.cs +++ b/OpenSim/Region/ClientStack/PacketServer.cs @@ -74,6 +74,14 @@ namespace OpenSim.Region.ClientStack } } + public virtual void ConnectionClosed(uint circuitCode) + { + if (this.ClientThreads.ContainsKey(circuitCode)) + { + ClientThreads[circuitCode].ConnectionClosed(); + } + } + /// /// /// diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index 45eb0cd..8b4a3cb 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs @@ -101,7 +101,23 @@ namespace OpenSim.Region.ClientStack ipeSender = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); epSender = (EndPoint)ipeSender; Packet packet = null; - int numBytes = Server.EndReceiveFrom(result, ref epSender); + + int numBytes; + + try + { + numBytes = Server.EndReceiveFrom(result, ref epSender); + } + catch (System.Net.Sockets.SocketException) + { + Console.WriteLine("Remote host Closed connection"); + this._packetServer.ConnectionClosed(this.clientCircuits[epSender]); + ipeSender = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); + epSender = (EndPoint)ipeSender; + Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); + return; + } + int packetEnd = numBytes - 1; packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); -- cgit v1.1