mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
From: Dong Jun Lan <landj@cn.ibm.com>
Set udp flags correctly to prevent "Socket forcibly closed by host" errors.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user