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

Making functions even faster #17

Closed guyluz11 closed 2 years ago

guyluz11 commented 2 years ago

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.

guyluz11 commented 2 years ago

You can assign it to me.

git-elliot commented 2 years ago

You can create another function and just remove progress callback from that if it's kott required at the moment.

guyluz11 commented 2 years ago

You can create another function and just remove progress callback from that if it's kott required at the moment.

I am seeing this now after the pull request, in the end I have added a flag for that.

Tell me if you want me to work on it again and remove the progress callback anyway.

git-elliot commented 2 years ago

Adding a flag is good idea since we don't have to maintain different functions. It's not much tedious right now, if more features are integrated, we will see later to split implementations. As of now, we are good to go