Skip to content

Commit

Permalink
feat: Disabled SIO_UDP_CONNRESET
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoTenPvP committed Jan 13, 2020
1 parent 664d6b3 commit a91a071
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Ruffles/Core/RuffleSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,24 @@ private bool SetupAndBind(Socket socket, IPEndPoint endpoint)

// Set the .NET buffer sizes. Defaults to 1 megabyte each
socket.ReceiveBufferSize = Constants.RECEIVE_SOCKET_BUFFER_SIZE;
socket.SendBufferSize = Constants.SEND_SOCKET_BUFFER_SIZE;
socket.SendBufferSize = Constants.SEND_SOCKET_BUFFER_SIZE;

try
{
const uint IOC_IN = 0x80000000;
const uint IOC_VENDOR = 0x18000000;
const uint SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12;

unchecked
{
socket.IOControl((int)SIO_UDP_CONNRESET, new byte[] { 0 }, null);
}

}
catch
{
// Ignore error when SIO_UDP_CONNRESET is not supported
}

try
{
Expand Down

0 comments on commit a91a071

Please sign in to comment.