aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs4
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs11
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs20
3 files changed, 24 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index ce7ee98..a69b670 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -2704,7 +2704,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2704 OutPacket(packet, ThrottleOutPacketType.Task); 2704 OutPacket(packet, ThrottleOutPacketType.Task);
2705 } 2705 }
2706 2706
2707 public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, 2707 public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] membershipType,
2708 string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, 2708 string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL,
2709 UUID partnerID) 2709 UUID partnerID)
2710 { 2710 {
@@ -2716,7 +2716,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2716 else 2716 else
2717 avatarReply.PropertiesData.AboutText = Utils.EmptyBytes; 2717 avatarReply.PropertiesData.AboutText = Utils.EmptyBytes;
2718 avatarReply.PropertiesData.BornOn = Util.StringToBytes256(bornOn); 2718 avatarReply.PropertiesData.BornOn = Util.StringToBytes256(bornOn);
2719 avatarReply.PropertiesData.CharterMember = charterMember; 2719 avatarReply.PropertiesData.CharterMember = membershipType;
2720 if (flAbout != null) 2720 if (flAbout != null)
2721 avatarReply.PropertiesData.FLAboutText = Util.StringToBytes256(flAbout); 2721 avatarReply.PropertiesData.FLAboutText = Util.StringToBytes256(flAbout);
2722 else 2722 else
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index a868e3a..cedb9b4 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -81,7 +81,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
81 uint port = (uint)scene.RegionInfo.InternalEndPoint.Port; 81 uint port = (uint)scene.RegionInfo.InternalEndPoint.Port;
82 82
83 IPAddress listenIP = scene.RegionInfo.InternalEndPoint.Address; 83 IPAddress listenIP = scene.RegionInfo.InternalEndPoint.Address;
84 Initialise(listenIP, ref port, scene.RegionInfo.ProxyOffset, scene.RegionInfo.m_allow_alternate_ports, m_Config, scene.AuthenticateHandler); 84 Initialise(listenIP, ref port, scene.RegionInfo.ProxyOffset, m_Config, scene.AuthenticateHandler);
85 scene.RegionInfo.InternalEndPoint.Port = (int)port; 85 scene.RegionInfo.InternalEndPoint.Port = (int)port;
86 86
87 AddScene(scene); 87 AddScene(scene);
@@ -98,9 +98,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
98 } 98 }
99 #endregion 99 #endregion
100 100
101 public virtual void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) 101 public virtual void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, IConfigSource configSource, AgentCircuitManager circuitManager)
102 { 102 {
103 m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager); 103 m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, configSource, circuitManager);
104 } 104 }
105 105
106 public virtual void AddScene(IScene scene) 106 public virtual void AddScene(IScene scene)
@@ -430,12 +430,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
430 public JobEngine OqrEngine { get; protected set; } 430 public JobEngine OqrEngine { get; protected set; }
431 431
432 public LLUDPServer( 432 public LLUDPServer(
433 IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, 433 IPAddress listenIP, ref uint port, int proxyPortOffsetParm,
434 IConfigSource configSource, AgentCircuitManager circuitManager) 434 IConfigSource configSource, AgentCircuitManager circuitManager)
435 : base(listenIP, (int)port) 435 : base(listenIP, (int)port)
436 { 436 {
437 #region Environment.TickCount Measurement 437 #region Environment.TickCount Measurement
438 438
439 // Update the port with the one we actually got
440 port = (uint)Port;
441
439 // Measure the resolution of Environment.TickCount 442 // Measure the resolution of Environment.TickCount
440 TickCountResolution = 0f; 443 TickCountResolution = 0f;
441 for (int i = 0; i < 10; i++) 444 for (int i = 0; i < 10; i++)
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
index 4d726b4..831381e 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs
@@ -107,6 +107,11 @@ namespace OpenMetaverse
107 /// </summary> 107 /// </summary>
108 public float AverageReceiveTicksForLastSamplePeriod { get; private set; } 108 public float AverageReceiveTicksForLastSamplePeriod { get; private set; }
109 109
110 public int Port
111 {
112 get { return m_udpPort; }
113 }
114
110 #region PacketDropDebugging 115 #region PacketDropDebugging
111 /// <summary> 116 /// <summary>
112 /// For debugging purposes only... random number generator for dropping 117 /// For debugging purposes only... random number generator for dropping
@@ -217,10 +222,6 @@ namespace OpenMetaverse
217 SocketType.Dgram, 222 SocketType.Dgram,
218 ProtocolType.Udp); 223 ProtocolType.Udp);
219 224
220 // OpenSim may need this but in AVN, this messes up automated
221 // sim restarts badly
222 //m_udpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false);
223
224 try 225 try
225 { 226 {
226 if (m_udpSocket.Ttl < 128) 227 if (m_udpSocket.Ttl < 128)
@@ -248,13 +249,22 @@ namespace OpenMetaverse
248 // we never want two regions to listen on the same port as they cannot demultiplex each other's messages, 249 // we never want two regions to listen on the same port as they cannot demultiplex each other's messages,
249 // leading to a confusing bug. 250 // leading to a confusing bug.
250 // By default, Windows does not allow two sockets to bind to the same port. 251 // By default, Windows does not allow two sockets to bind to the same port.
251 m_udpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false); 252 //
253 // Unfortunately, this also causes a crashed sim to leave the socket in a state
254 // where it appears to be in use but is really just hung from the old process
255 // crashing rather than closing it. While this protects agains misconfiguration,
256 // allowing crashed sims to be started up again right away, rather than having to
257 // wait 2 minutes for the socket to clear is more valuable. Commented 12/13/2016
258 // m_udpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false);
252 259
253 if (recvBufferSize != 0) 260 if (recvBufferSize != 0)
254 m_udpSocket.ReceiveBufferSize = recvBufferSize; 261 m_udpSocket.ReceiveBufferSize = recvBufferSize;
255 262
256 m_udpSocket.Bind(ipep); 263 m_udpSocket.Bind(ipep);
257 264
265 if (m_udpPort == 0)
266 m_udpPort = ((IPEndPoint)m_udpSocket.LocalEndPoint).Port;
267
258 IsRunningInbound = true; 268 IsRunningInbound = true;
259 269
260 // kick off an async receive. The Start() method will return, the 270 // kick off an async receive. The Start() method will return, the