Use OperatingSystem.IsWindows() and OperatingSystem.IsMacOS() instead of the custom OS detection
Use Marshal.PtrToStringUTF8 instead of custom Utf8toString method
Introduce Native.ShouldThrow to avoid throwing because of the Apple Bonjour compatibility layer of Avahi warnings:
WARNING The program 'azclient' uses the Apple Bonjour compatibility layer of Avahi.
WARNING Please fix your application to use the native API of Avahi!
WARNING For more information see http://0pointer.de/blog/projects/avahi-compat.html WARNING The program 'azclient' called 'DNSServiceCreateConnection()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
WARNING Please fix your application to use the native API of Avahi!
Utf8toString
method