diff --git a/network_tools/lib/src/mdns_scanner/mdns_scanner.dart b/network_tools/lib/src/mdns_scanner/mdns_scanner.dart index 8293f45..31926b9 100644 --- a/network_tools/lib/src/mdns_scanner/mdns_scanner.dart +++ b/network_tools/lib/src/mdns_scanner/mdns_scanner.dart @@ -49,7 +49,23 @@ class MdnsScanner { ) async { final List mdnsFoundList = []; - final MDnsClient client = MDnsClient(); + final MDnsClient client = MDnsClient( + rawDatagramSocketFactory: ( + dynamic host, + int port, { + bool? reuseAddress, + bool? reusePort, + int? ttl, + }) { + return RawDatagramSocket.bind( + host, + port, + reusePort: Platform.isWindows ? false : true, + ttl: ttl!, + ); + }, + ); + await client.start(); await for (final PtrResourceRecord ptr in client.lookup(