dart_ping icon indicating copy to clipboard operation
dart_ping copied to clipboard

Ios device ping in lan_scanner does not complete

Open Silverviql opened this issue 1 year ago • 0 comments

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.

image

`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,
    );
  }
}

}`

image

Any ideas what this might be connected with?

Silverviql avatar Apr 05 '24 12:04 Silverviql