dart_ping
dart_ping copied to clipboard
Ios device ping in lan_scanner does not complete
I start example project lan_scanner and call scanner.quickIcmpScanSync where inside the ping method is called which, due to overflow or something else, cannot complete. If I change the values of firstIP and lastIP in quickIcmpScanSync method to int firstIP = 19, int lastIP = 255, or int firstIP = 1, int lastIP = 237, the method works completely and returns a list in this range.
`Future<Host?> _pingHost( String target, { required int timeout, }) async { late Ping pingRequest;
try {
pingRequest =
Ping(target, count: 1, timeout: timeout, forceCodepage: true);
} catch (exc) {
if (exc is UnimplementedError &&
(exc.message?.contains('iOS') ?? false)) {
log(
"DartPingIOS.register() hasn't been called or you are using async version of the function, see the readme at https://pub.dev/packages/lan_scanner",
);
} else {
rethrow;
}
}
await for (final data in pingRequest.stream) {
if (debugLogging) {
log('$data from $target');
}
if (data.response != null && data.error == null) {
final response = data.response!;
return Host(
internetAddress: InternetAddress(target),
pingTime: response.time != null
? Duration(microseconds: response.time!.inMicroseconds)
: null,
);
}
}
}`
Any ideas what this might be connected with?