ping_discover_network 0.1.0 copy "ping_discover_network: ^0.1.0" to clipboard
ping_discover_network: ^0.1.0 copied to clipboard

outdated

The library allows to ping IP subnet and therefore discover network devices. Could be used to find printers (for example, on port 9100) and any other devices and services in local network..

example/main.dart

/*
 * ping_discover_network
 * Created by Andrey Ushakov
 * 
 * See LICENSE for distribution and usage details.
 */
import 'package:ping_discover_network/ping_discover_network.dart';

/// Discover available network devices in a given subnet on a given port
void main() {
  const port = 80;
  final stream = NetworkAnalyzer.discover('192.168.0', port);

  int found = 0;
  stream.listen((NetworkAddress addr) {
    if (addr.exists) {
      found++;
      print('Found device: ${addr.ip}:$port');
    }
  }).onDone(() => print('Finish. Found $found device(s)'));
}
70
likes
0
points
26
downloads

Publisher

verified publishertablemi.com

Weekly Downloads

The library allows to ping IP subnet and therefore discover network devices. Could be used to find printers (for example, on port 9100) and any other devices and services in local network..

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on ping_discover_network