Closed ivirtex closed 2 years ago
This could have been a good change if discover (now name getting changed to getAllPingableDevices) didn't support changing the timeout.
So if the developer changes the timeout to 1 minute then the results can also not get returned at approximately the same time in Stream.
If the address is Class A, user have to wait for all the futures to be completed in order to get the result from getAllPingableDevices(formerly discover) method. https://github.com/git-elliot/network_tools/blob/ffcd5ed42a457c0646c5589132f4a6a98ef66667/network_tools/lib/src/host_scanner.dart#L25
Right, I forgot about the timeout property.
Since all ping actions are started asynchronously, they will complete aprroximately at the same time. This means that almost all the results are yielded also at the same time, this behaviour doesn't really fit the purpose of Dart's streams. Converting
HostScanner.discover
to return aFuture
would simplify the code and logic.