From e713a3c62a521920b39a8f30fe9658cacc74eb3b Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 3 Jun 2008 13:49:58 +0000 Subject: From: Dong Jun Lan Set udp flags correctly to prevent "Socket forcibly closed by host" errors. --- OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 5fbc7c0..7f221ae 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -408,6 +408,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP ServerIncoming = new IPEndPoint(listenIP, (int)newPort); m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); m_socket.Bind(ServerIncoming); + // Add flags to the UDP socket to prevent "Socket forcibly closed by host" + uint IOC_IN = 0x80000000; + uint IOC_VENDOR = 0x18000000; + uint SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12; + m_socket.IOControl((int)SIO_UDP_CONNRESET, new byte[] { Convert.ToByte(false) }, null); + listenPort = newPort; m_log.Info("[SERVER]: UDP socket bound, getting ready to listen"); -- cgit v1.1