-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SocketException in example/lib/scan/mdns_scan.dart #192
Comments
I know what the reason is, but I can't change it. This is caused by a bug in the multicast_dns. The file in this library multicast_dns - 0.3.2 + 6\ lib\ multicast_dns.dart line 63 gets all NetInterfaces, but I have two NetworkInterfaces that are closed, so using a socket to connect the two NetInterfaces makes an error. Future<Iterable<NetworkInterface>> allInterfacesFactory(
InternetAddressType type) {
return NetworkInterface.list( // ---> here
includeLinkLocal: true,
type: type,
includeLoopback: true,
);
} |
I found a solution, but I don't know if it's right. in file lib/src/services/impls/mdns_scanner_service_impl.dart line 73 await client.start(); to await client.start(interfacesFactory: (InternetAddressType type){
return NetworkInterface.list(
includeLinkLocal: false, // old is true
type: type,
includeLoopback: true,
);
},); or await client.start(interfacesFactory: (InternetAddressType type){
return NetworkInterface.list(
includeLinkLocal: true,
type: type,
includeLoopback: true,
).then((List<NetworkInterface> list){
list.removeWhere((item){
if(ping item is not ok) return true; // remove this item
return false; // ping item is ok
});
return list;
});
},); |
|
But I don't think that this is the right place to fix it. If we can fix it in package |
I ran example/lib/scan/mdns_scan.dart and got the following error:
My Environment: windows 10 chinese
The text was updated successfully, but these errors were encountered: