Giter Club home page Giter Club logo

osociety / network_tools Goto Github PK

View Code? Open in Web Editor NEW
41.0 3.0 13.0 1.15 MB

Networking Tools library which can help you discover open ports, devices on subnet and many other things.

Home Page: https://pub.dev/packages/network_tools

License: BSD 3-Clause "New" or "Revised" License

Dart 97.86% Shell 2.14%
dart flutter android ios linux macos windows pub port-scanner scanner networking pub-dev host-scanner networkingtool networktools hacktoberfest

network_tools's Introduction

Network Tools

pub package Dart codecov

Network Tools Supported

  1. Host Scanner

    1. Search all devices on subnet
    2. Get mac address of devices on Linux, macOS and Windows.
    3. Search devices for a specific port open.
  2. Port Scanner

    1. Single Port scan
    2. Range
    3. Custom

Partly Work:

  1. Mdns Scanner

Network Tools Flutter package

Please check network_tools_flutter package for extensive support to features on different platforms.

Import package in your app

import 'package:network_tools/network_tools.dart';

Configure network tools in main function

For dart native

Future<void> main() async {
  await configureNetworkTools('build', enableDebugging: true);
  runApp(const MyApp());
}

For flutter apps

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  // It's necessary to pass correct path to be able to use this library.
  final appDocDirectory = await getApplicationDocumentsDirectory();
  await configureNetworkTools(appDocDirectory.path, enableDebugging: true);
  runApp(const MyApp());
}

Usage

Host Scanner

 String address = '192.168.1.12';
  // or You can also get address using network_info_plus package
  // final String? address = await (NetworkInfo().getWifiIP());
  final String subnet = address.substring(0, address.lastIndexOf('.'));
  final stream = HostScannerService.instance.getAllPingableDevices(subnet, firstHostId: 1, lastHostId: 50,
      progressCallback: (progress) {
    print('Progress for host discovery : $progress');
  });

  stream.listen((host) {
    //Same host can be emitted multiple times
    //Use Set<ActiveHost> instead of List<ActiveHost>
    print('Found device: $host');
  }, onDone: () {
    print('Scan completed');
  }); // Don't forget to cancel the stream when not in use.

Port Scanner

  //1. Range
  String target = '192.168.1.1';
  PortScannerService.instance.scanPortsForSingleDevice(target, startPort: 1, endPort: 1024,
      progressCallback: (progress) {
    print('Progress for port discovery : $progress');
  }).listen((ActiveHost event) {
    if (event.openPorts.isNotEmpty) {
      print('Found open ports : ${event.openPorts}');
    }
  }, onDone: () {
    print('Scan completed');
  });
  //2. Single
  bool isOpen = (await PortScanner.isOpen(target, 80)) == null;
  //3. Custom
  PortScanner.customDiscover(target, portList: const [22, 80, 139]);

Mdns Scanner

  for (final ActiveHost activeHost in await MdnsScannerService.instance.searchMdnsDevices()) {
    final MdnsInfo? mdnsInfo = await activeHost.mdnsInfo;
    print('''
    Address: ${activeHost.address}
    Port: ${mdnsInfo!.mdnsPort}
    ServiceType: ${mdnsInfo.mdnsServiceType}
    MdnsName: ${mdnsInfo.getOnlyTheStartOfMdnsName()}
    ''');
  }

Run examples

  1. Run host scan : dart example/host_scan.dart
  2. Run port scan : dart example/port_scan.dart
  3. Run mdns scan : dart example/mdns_scan.dart

Sample App

Vernet is the open source app built on top of this library. You can check out the code and implementation for more detailed use case of this package.

Support and Donate

  1. Support this project by becoming stargazer of this project.

  2. Buy me a coffee.

    Librepay
    Donate using Liberapay
  3. Support me on Ko-Fi

    ko-fi

Inspired from ping_discover_network

network_tools's People

Contributors

asher-gh avatar aviavinav avatar dependabot[bot] avatar git-elliot avatar guyluz11 avatar kengu avatar stausssi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

network_tools's Issues

Bump package version

The package currently released under version 0.0.6

image

This makes people think that it is not ready yet.

My suggestion to bump it into 1.0.6 as it is ready for production.

Error when adding package to project. - Error: The argument type 'InternetAddress/*1*/' can't be assigned to the parameter type 'InternetAddress/*2*/'

{user}/AppData/Local/Pub/Cache/hosted/pub.dev/network_tools-3.0.0+3/lib/src/mdns_scanner/mdns_scanner.dart:102:28: Error: The argument type 'InternetAddress/1/' can't be assigned to the parameter type 'InternetAddress/2/'.

  • 'InternetAddress/1/' is from 'dart:io'.
  • 'InternetAddress/2/' is from 'package:universal_io/src/internet_address.dart' ('/{user}/AppData/Local/Pub/Cache/hosted/pub.dev/universal_io-2.2.0/lib/src/internet_address.dart').
    internet_address.dart:1
    internetAddress: internetAddress,

`HostScanner.discover` should run inside an isolate by default

Since HostScanner.discover runs on the main thread, the whole UI freezes until host discovery finishes. This means more work for the developers und unnecessary confusion.
Putting the whole process inside an isolate would unblock app interaction.

Making functions even faster

We can make the functions retrieve results event fester if we will not return them in ascending order.

The overall speed of the function will remain the same but some of the results will be retrieved faster.
In my case I need the first device that has a specific open port so I don't need to wait for all the others at the end of the code just so that the results will be in ascending order.

Let's create another option that will just retrieve the first thing that it finds.

I can't think of a way to retrieve the progress percentage with it as it runs in "chaos mod" so it will be a progressless indication.

Example crash on Windows

Not working on Windows

Unhandled exception:
SocketException: Connection failed (OS Error: The requested address is not valid in its context.
, errno = 10049), address = 192.168.1.1, port = 0
#0      _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:681:35)
#1      _NativeSocket.connect (dart:io-patch/socket_patch.dart:940:12)
#2      _RawSocket.connect (dart:io-patch/socket_patch.dart:1796:26)
#3      RawSocket.connect (dart:io-patch/socket_patch.dart:21:23)
#4      Socket._connect (dart:io-patch/socket_patch.dart:2019:22)
#5      Socket.connect (dart:io/socket.dart:770:21)
#6      PortScanner.connectToPort (package:network_tools/src/port_scanner.dart:131:37)
#7      PortScanner.customDiscover (package:network_tools/src/port_scanner.dart:75:28)
<asynchronous suspension>

Process finished with exit code 255

Tested with my home IP but posted with the example IP.

Big unnecessary log on windows when running mdns scan

Whan I run the mDNS example on windows I am getting this in the console

Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194: reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePortnot supported for Windows.Dart Socket ERROR: ../../runtime/bin/socket_win.cc:194:reusePort not supported for Windows

It does not seem to affect functionality but it isn't very pleasant.
This happens to me only on windows, also tested on Linux.

mDNS scan crashes on macOS apple silicon

I had the latest changes of your dev branch @guyluz11 but the mDNS scan still breaks on IPv6 Addresses. I'm attaching the output here.

Unhandled exception:
FormatException: Invalid radix-10 number (at character 1)
1%lo0
^

#0      int._handleFormatError (dart:core-patch/integers_patch.dart:131:5)
#1      int._parseRadix (dart:core-patch/integers_patch.dart:142:16)
#2      int._parse (dart:core-patch/integers_patch.dart:103:12)
#3      int.parse (dart:core-patch/integers_patch.dart:65:12)
#4      new ActiveHost (package:network_tools/src/models/active_host.dart:19:20)
#5      MdnsScanner._findingMdnsWithIp (package:network_tools/src/mdns_scanner/mdns_scanner.dart:75:37)
<asynchronous suspension>

Output of dns-sd -B _services._dns-sd._udp local

Browsing for _services._dns-sd._udp.local
DATE: ---Thu 28 Jul 2022---
21:23:52.300  ...STARTING...
Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
21:23:52.301  Add        3   4 .                    _tcp.local.          _airplay
21:23:52.301  Add        3   4 .                    _tcp.local.          _raop
21:23:52.301  Add        3   5 .                    _tcp.local.          _airplay
21:23:52.301  Add        3   5 .                    _tcp.local.          _raop
21:23:52.301  Add        3   1 .                    _tcp.local.          _airplay
21:23:52.301  Add        3   1 .                    _tcp.local.          _raop
21:23:52.301  Add        3  11 .                    _tcp.local.          _airplay
21:23:52.301  Add        3  11 .                    _tcp.local.          _raop
21:23:52.301  Add        2  11 .                    _udp.local.          _mi-connect

Output of dns-sd -B _ipp._tcp local

Browsing for _ipp._tcp.local
DATE: ---Thu 28 Jul 2022---
21:25:36.057  ...STARTING...

OSError (OS Error: Too many open files, errno = 24)

I'm running a new template Flutter application and using the example/port_scan.dart code but when I run it on my iOS simulator I'm getting the error OSError (OS Error: Too many open files, errno = 24)

I am able to run the host and mdns examples fine. So I'm not sure what I'm doing wrong here?

`PortScanner.discover` crash on Windows when scanning too many ports at once

PortScanner.discover crash on Windows when scanning too many ports at once.

In my case the code got crash when running this

 PortScanner.discover(
    target,
    startPort: 1,
    endPort: 16350,

And didn't got crash when running this

PortScanner.discover(
    target,
    startPort: 20,
    endPort: 16350,

Here is the crash

Unhandled exception:
SocketException: Connection failed (OS Error: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.
, errno = 10055), address = 192.168.1.39, port = 16342
#0      _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:681:35)
#1      _NativeSocket.connect (dart:io-patch/socket_patch.dart:940:12)
#2      _RawSocket.connect (dart:io-patch/socket_patch.dart:1796:26)
#3      RawSocket.connect (dart:io-patch/socket_patch.dart:21:23)
#4      Socket._connect (dart:io-patch/socket_patch.dart:2019:22)
#5      Socket.connect (dart:io/socket.dart:770:21)
#6      PortScanner.connectToPort (package:network_tools/src/port_scanner.dart:156:37)
#7      PortScanner.customDiscover (package:network_tools/src/port_scanner.dart:87:13)
<asynchronous suspension>

Even more points in pub.dev page

I believe we can reach even more points in pub.dev page.

Currently it is subtracting points on pubspec.yaml

Documentation URL isn't helpful.

Not sure what it is but it can be good to fix it and get more points.

image

Maybe we can even support the web/flutter js by converting the dart from dart.io to universal_io.
It does not remove any points for us but why not if it is that easy

image

Search devices in network with specified open ports

If I understand correctly from the existing examples we can search for hosts and we can search open ports in specific host but we can't do both searches combined.

For example get all IPs of hosts that have port x open.

Off cores I can search specific port for each result from the hosts search but this is very slow 5.3m.
Searching for hosts with specific port open should be very quick, in ping_discover_network_forked I get for the same search about 3s.

Even supporting the hosts search with one specified port can be useful (like existing in ping_discover_network_forked) in case multiple open ports search at once is hard to implement.

PortScanner.discover crash on some ports when its scan its own Windows machine

PortScanner.discover crash when it runs on the IP of the same Windows machine that I got run on.

It is not happaning on all the ports, for example 1-136 runs fine, but 136-137 crash

PortScanner.discover(
    target,
    startPort: 136  ,
    endPort: 137,

This is the error that I get

Unhandled exception:
SocketException: OS Error: A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
, errno = 10057, address = 192.168.1.251, port = 65527
#0      _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:681:35)
#1      _NativeSocket.connect (dart:io-patch/socket_patch.dart:940:12)
#2      _RawSocket.connect (dart:io-patch/socket_patch.dart:1796:26)
#3      RawSocket.connect (dart:io-patch/socket_patch.dart:21:23)
#4      Socket._connect (dart:io-patch/socket_patch.dart:2019:22)
#5      Socket.connect (dart:io/socket.dart:770:21)
#6      PortScanner.connectToPort (package:network_tools/src/port_scanner.dart:156:37)
#7      PortScanner.customDiscover (package:network_tools/src/port_scanner.dart:87:13)
<asynchronous suspension>

This bug does not really affect me, so I am just reporting it.

Default last subnet 50 should get replaced to 254

Can we combine ActiveHost and OpenPort?

I am thinking that using only one interface will be easier for developers to use our package.

Moreover I think it will be easier to maintain if we will work with one object for hosts.

Can I create pr that will use OpenPort inside ActiveHost and remove the IP from it?.

Support for getting host name

Is there a way to get a hostname/dns name from specific IP?.
Or even better, have a way to get the hostname of all the IPs during the scan?.

If not what are the steps that missing in order to add this feature.

mdns no result on arm architecture

Testing mdns example on my arm architecture device I don't get any results, and there are no errors.

The same example return results in regular x64.

arm is also known as ARMv7 and armhf.

Adding support for UPnP

As this package is suited to bring the programmer a lot of network tools in one place it will be nice to add support for UPnP

There were several UPnP dart packages in the past but they are not maintained, I have found (and tested a little bit) a new package named upnp2 that picked up from the old ones.

Let's add support for searching UPnP devices in the network using the discovery method from that package.

Add support for getting vendor

Not sure if this should be part of this package, but getting the vendor of the device for example from the mac address (blocker #7) can be nice.

Both discover and customDiscover can get faster with async

First of all I think that the code can get combined and there is a lot of duplicate code.

In port_scanner.dart discover should call customDiscover with values.
And I think customDiscover should call isOpen that will call connectToPort

I suggest doing this first and then make customDiscover work async and ping all the ports to IP at once and not waiting for each one to complete.

PortScanner.discover The remote computer refused the network connection.

I am running this commend

  PortScanner.discover(
    target,
    startPort: 8000,
    endPort: 8500,
    timeout: const Duration(milliseconds: 5000),

and getting this crash

Unhandled exception:
SocketException: OS Error: The remote computer refused the network connection.
, errno = 1225, address = 192.168.1.39, port = 64984
#0      _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:681:35)
#1      _NativeSocket.connect (dart:io-patch/socket_patch.dart:940:12)
#2      _RawSocket.connect (dart:io-patch/socket_patch.dart:1796:26)
#3      RawSocket.connect (dart:io-patch/socket_patch.dart:21:23)
#4      Socket._connect (dart:io-patch/socket_patch.dart:2019:22)
#5      Socket.connect (dart:io/socket.dart:770:21)
#6      PortScanner.connectToPort (package:network_tools/src/port_scanner.dart:156:37)
#7      PortScanner.customDiscover (package:network_tools/src/port_scanner.dart:87:13)
<asynchronous suspension>

If I am changing the duration to milliseconds: 1000 for example I don't get this crash.

The program should not crash, it should catch the error and continue running on the rest of the ports.

Saving the response time from each device

We can easily save the response time of each device whenever we get the response.

This could be useful for knowing if there is a problem with the device like overload (it is slowing down) or if it has a weak WiFi signal.

Support multiple platforms

Currently we are getting 10 less points in pub.dev for missing support for multiple platforms

image

This is caused because dart:io is missing support for web and more
for that we can use universal_io that is

A cross-platform dart:io that works in all platforms (browsers, mobile, desktop, and server-side).

Web support got removed

Web support got removed and can return.

We accidentally (I think) add referenced io package in our code instead of universal_io.

Let's bring it back.

image

Error runnig getAllPingableDevices inside snap confinement

As I am using this package inside of a snap there can be new limitations that can happen.
Snap is a very confined environment and the developer needs to specify in advance (and sometimes get permission) in order to use different systems calls and info.

This leads me to a new bug that I am not sure how much it is common to get and it is permission denied on using the avahi-browse command.

This is my log.

  Check that /usr/bin/timeout exists
    command: timeout 2s avahi-browse --all -p
  Check that /usr/bin/timeout exists
    command: timeout 2s mdns-scan
You can make the mdns process better by installing `mdns-scan`
Unhandled exception:
ProcessException: Permission denied
  Command: ping -O -n -W 1 -i 1 -t 255 -c 1 192.168.31.1
#0      _ProcessImpl._start (dart:io-patch/process_patch.dart:401)
#1      Process.start (dart:io-patch/process_patch.dart:38)
#2      BasePing.platformProcess (package:dart_ping/src/ping/base_ping.dart:71)
#3      BasePing._onListen (package:dart_ping/src/ping/base_ping.dart:86)
#4      _runGuarded (dart:async/stream_controller.dart:814)
#5      _StreamController._subscribe.<anonymous closure> (dart:async/stream_controller.dart:692)
#6      _BufferingStreamSubscription._guardCallback (dart:async/stream_impl.dart:417)
#7      _StreamController._subscribe (dart:async/stream_controller.dart:691)
#8      _ControllerStream._createSubscription (dart:async/stream_controller.dart:827)
#9      _StreamImpl.listen (dart:async/stream_impl.dart:473)
#10     _StreamIterator._initializeOrDone (dart:async/stream_impl.dart:1028)
#11     _StreamIterator.moveNext (dart:async/stream_impl.dart:1004)
#12     HostScanner._getHostFromPing (package:network_tools/src/host_scanner.dart)
#13     HostScanner.getAllPingableDevices (package:network_tools/src/host_scanner.dart:41)
<asynchronous suspension>

To fix that and still allow a better way of finding all the SRV lists in Linux if it is possible I am suggesting the following.

  1. Short fix for most cases - by default it will not use the Linux-specific implementation, a boolean value can be passed if needed.
  2. We find a way to catch the error and in case of missing permission it calls the non-Linux specific implementation.

I think 2 will be a little difficult since it is hard to debug the program when it runs as a snap so we can just level it open and not touch it at all.
We can add to it p4 after completing 1 for now.

A possible solution to platform limitation lable

I think that I have found a new solution to fix platform limitation label issues.

In the Readme part of https://github.com/point-source/dart_ping ios part it is saying

dart_ping_ios is a plugin which adds cocoa dependencies to support ping on iOS systems. Using this plugin requires the Flutter SDK to be added to your dart project.

This way his package can support both native Linux and flutter-dependent functionality in the same package which is pretty cool.

This could be our current solution to a lot of our problems, this means supporting some functionality only on specific platforms but I think it is better than nothing.

My suggestion is to split the package into dart native and flutter package as dart_ping did (I think), and on some platforms the flutter parts will help us use specific calls that can solve our missing functionality like using native (for example) android (in java) packages or to use flutter only package.

If the developer tries to call some function that supports only a specific platform in the wrong platform it will return empty data or will throw an error that this functionality does not support on that platform.

mdns crash when started in windows connected to WiFi

Running mDNS example under windows 10 when connected to WiFi I am getting this error.

Unhandled exception:
SocketException: Failed to create datagram socket (OS Error: The requested address is not valid in its context.
, errno = 10049), address = , port = 5353
#0      _NativeSocket.bindDatagram (dart:io-patch/socket_patch.dart:1015:7)
<asynchronous suspension>
#1      MDnsClient.start (package:multicast_dns/multicast_dns.dart:135:40)
<asynchronous suspension>
#2      MdnsScanner._findingMdnsWithAddress (package:network_tools/src/mdns_scanner/mdns_scanner.dart:72:5)
<asynchronous suspension>

Cannot reproduce when connected to the network using a cable.

Host scanner

Can we have MAC address of host?
Since code is pinging IP address, this info can be retrieved also.

mdns_scanner crash if started without any network

When I am starting mDNS search without any connected network I am expecting it to return an empty result.
But I am getting crash that is not being handled.

Log from my program (running on dart native):

Unhandled exception:
SocketException: Send failed (OS Error: Network is unreachable, errno = 101), address = 0.0.0.0, port = 5353
#0      _NativeSocket.send (dart:io-patch/socket_patch.dart:1213:34)
#1      _RawDatagramSocket.send (dart:io-patch/socket_patch.dart:2450:15)
#2      MDnsClient.lookup (package:multicast_dns/multicast_dns.dart:225:14)
#3      MdnsScanner._findingMdnsWithAddress (package:network_tools/src/mdns_scanner/mdns_scanner.dart:71:54)
<asynchronous suspension>
#4      MdnsScanner.searchMdnsDevices (package:network_tools/src/mdns_scanner/mdns_scanner.dart:41:29)
<asynchronous suspension>
#5      CompaniesConnectorConjector.searchAllMdnsDevicesAndSetThemUp (package:cbj_hub/infrastructure/devices/companies_connector_conjector.dart:144:43)
<asynchronous suspension>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.