ela-compil / BACnet

BACnet protocol library for .NET :satellite:
https://www.nuget.org/packages/bacnet/
MIT License
215 stars 95 forks source link

Socket option Dont Fragment not supported on MacOS #91

Open roordaj opened 2 years ago

roordaj commented 2 years ago

When using the library on MacOS, I get the following error:

Unhandled exception. System.Net.Sockets.SocketException (45): Operation not supported at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue, Boolean silent) at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue) at System.Net.Sockets.Socket.set_DontFragment(Boolean value) at System.Net.Sockets.UdpClient.set_DontFragment(Boolean value) at System.IO.BACnet.BacnetIpUdpProtocolTransport.Open() at System.IO.BACnet.BacnetIpUdpProtocolTransport.Start() at System.IO.BACnet.BacnetClient.Start()

This is because the MacOS socket does not support that option. A solution might be to omit the setting when not specified explicitly in the constructor.

YarekTyshchenko commented 1 year ago

Should be fixed by #116 Can you check with the latest version of the lib? Duplicate of #115