ValentinBELYN / icmplib

Easily forge ICMP packets and make your own ping and traceroute.
GNU Lesser General Public License v3.0
276 stars 45 forks source link

Unnecessary last `sleep()` in `multiping()` #84

Closed rysson closed 5 months ago

rysson commented 5 months ago

Hi,

in ping() is condition to avoid sleep() after last request and it's missing in multiping().

Try:

multiping(['127.0.0.1'], count=1, interval=60, timeout=1)
ValentinBELYN commented 5 months ago

Hi @rysson,

There is no sleep() in the multiping function.

https://github.com/ValentinBELYN/icmplib/blob/433c6523f254a4d09ba0ebc2b71ddc15e123e0f8/icmplib/multiping.py#L141-L163

For my part, if I try the line of code that you gave me, I get the result instantly.

If you notice a delay before obtaining the result, perhaps the problem comes from elsewhere? What is your operating system and the version of Python you are using?

rysson commented 5 months ago

Oh no, it's my mistake. I don't know how, but I look info 2.x version.