Skip to content

Ios device ping in lan_scanner does not complete #64

@Silverviql

Description

@Silverviql

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions