From ee58beddece251f58e3befb0b6aa7f78d5ab372b Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 13 Dec 2016 14:43:10 +0000 Subject: Make sure sims on Linux can be restarted without waiting on a 2 mintue socket timeout --- OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs index 4d726b4..fffd02c 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/OpenSimUDPBase.cs @@ -217,10 +217,6 @@ namespace OpenMetaverse SocketType.Dgram, ProtocolType.Udp); - // OpenSim may need this but in AVN, this messes up automated - // sim restarts badly - //m_udpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false); - try { if (m_udpSocket.Ttl < 128) @@ -248,7 +244,13 @@ namespace OpenMetaverse // we never want two regions to listen on the same port as they cannot demultiplex each other's messages, // leading to a confusing bug. // By default, Windows does not allow two sockets to bind to the same port. - m_udpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false); + // + // Unfortunately, this also causes a crashed sim to leave the socket in a state + // where it appears to be in use but is really just hung from the old process + // crashing rather than closing it. While this protects agains misconfiguration, + // allowing crashed sims to be started up again right away, rather than having to + // wait 2 minutes for the socket to clear is more valuable. Commented 12/13/2016 + // m_udpSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, false); if (recvBufferSize != 0) m_udpSocket.ReceiveBufferSize = recvBufferSize; -- cgit v1.1