lidgren / lidgren-network-gen3

Lidgren Network Library
https://groups.google.com/forum/#!forum/lidgren-network-gen3
MIT License
1.19k stars 331 forks source link

Memory Allocation fixes, MacOS platform bug on mono fixed #91

Closed RevoluPowered closed 6 years ago

RevoluPowered commented 6 years ago

This adds support for the following features:

Turns out that Lidgren.Network/NetPeer.Internal.cs had calls to uint SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12; m_socket.IOControl((int)SIO_UDP_CONNRESET, new byte[] { Convert.ToByte(false) }, null);

which can't properly function on OS X, mono has a bug which prevents the exception being thrown properly like it is on Linux or Windows, if SIO_UDP_CONNRESET is called.

What would normally happen on OS X without this fix is SIGABRT in mono and it would then dump a stack trace. (purely because the exception wasn't thrown)

I've added checks which work fine on Linux, mac and windows.

Tested on: