ela-compil / BACnet

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

Setting `.DontFragment` on `UdpClient` on MacOS fails with an exception #115

Closed YarekTyshchenko closed 1 year ago

YarekTyshchenko commented 1 year ago

This is a stack trace (private info removed) running on OSX. The culprit seems to be this assignment, it throws an exception on OSX. https://github.com/ela-compil/BACnet/blob/22537b585d389f662cbb2a900fb55169d3f01d3e/Transport/BacnetIpUdpProtocolTransport.cs#L103

Unhandled exception. System.Net.Sockets.SocketException (45): Operation not supported
   at BacnetIpUdpProtocolTransport.Open() in BacnetIpUdpProtocolTransport.cs:line 127
   at BacnetIpUdpProtocolTransport.Start() in BacnetIpUdpProtocolTransport.cs:line 207
   at System.IO.BACnet.BacnetClient.Start()

In my patched version I just catch and ignore, but would be nice to know how to actually handle this.

YarekTyshchenko commented 1 year ago

https://github.com/dotnet/runtime/issues/27653