osociety / network_tools

Networking Tools library which can help you discover open ports, devices on subnet and many other things.
https://pub.dev/packages/network_tools
BSD 3-Clause "New" or "Revised" License
45 stars 13 forks source link

Switched to getAllPingableDevicesAsync and never saw OnDone #112

Closed kostadin24 closed 1 year ago

kostadin24 commented 1 year ago

Until now I was using getAllPingableDevices - works fine. Switched to version with isolate - getAllPingableDevicesAsync. Now I see my devices by ping, but onDone is not executed. Also default for resultsInAddressAscendingOrder=true is ignored This is my code: final stream3 = HostScanner.getAllPingableDevicesAsync(subnet);//, firstHostId: 1, lastHostId: 254); StreamSubscription ss3 = stream3.listen((host) { list.add(host); print('${host.address}'); }, onDone: () { print('PING stream completed'); }); // Don't forget to cancel the stream when not in use.

This is my output: I/flutter (23907): 192.168.1.1 I/flutter (23907): 192.168.1.167 I/flutter (23907): 192.168.1.177 I/flutter (23907): 192.168.1.188 I/flutter (23907): 192.168.1.197 I/flutter (23907): 192.168.1.113 I/flutter (23907): 192.168.1.130 I/flutter (23907): 192.168.1.149

Message 'PING stream completed' is never printed.

Im on Android 13 Pixel5. Flutter version 3.7.11. network_tools: ^3.2.1

git-elliot commented 1 year ago

Ohh looks like stream is not closed properly. Will look into that.

git-elliot commented 1 year ago

@kostadin24 implementation in v3.2.2 has changed, can you check with latest version and tell us.

kostadin24 commented 10 months ago

Hi, sorry for not confirming it for months :( But other urgent stuff appeared. With version 4.0.2 of plugn: I see OnDone when use resultsInAddressAscendingOrder: true Never see OnDone when resultsInAddressAscendingOrder: false

guyluz11 commented 10 months ago

You are using HostScanner Should use HostScannerFlutter