Closed bladernr closed 7 years ago
This is pretty easily resolved (on linux, Ubuntu 16.04, Python 3.5.2) by changing self.waittime to a default of None instead.
diff --git a/pingparsing/_pingtransmitter.py b/pingparsing/_pingtransmitter.py index e723029..eaa5fa3 100644 --- a/pingparsing/_pingtransmitter.py +++ b/pingparsing/_pingtransmitter.py @@ -64,7 +64,7 @@ class PingTransmitter(object):
def __init__(self):
self.destination_host = ""
Thank you for your report.
I've fixed the issue at pingparsing 0.5.0
I believe the count
attribute will behave as you expected, in this version.
Could you try this version?
@bladernr
I'll close the issue since three weeks passed from the last comment.
I believe the issue fixed in pingparsing 0.5.0
.
Feel free to reopen.
Hi, sorry for the delay. Things are a bit crazy at Canonical right now :(
But I have checked and the count does work correctly now. thanks for the quick fix!
On Fri, Apr 14, 2017 at 10:50 AM, Tsuyoshi Hombashi < notifications@github.com> wrote:
@bladernr https://github.com/bladernr I'll close the issue since three weeks passed from the last comment. I believe the issue fixed in pingparsing 0.5.0. Feel free to reopen.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/thombashi/pingparsing/issues/24#issuecomment-294166981, or mute the thread https://github.com/notifications/unsubscribe-auth/AEGLSCOChQ-syYNtjEmxeGYhQNnrzvWgks5rv4engaJpZM4MkRlv .
-- Jeff Lane - Server Certification Lead, Tools Developer, Warrior Poet, Lover of Pie Ubuntu Ham: W4KDH Freenode IRC: bladernr or bladernr_ gpg: 1024D/3A14B2DD 8C88 B076 0DD7 B404 1417 C466 4ABD 3635 3A14 B2DD
It's my pleasure. Thank you for checking.
When using PingTransmitter(), regardless of what you set as the count, only 1 packet is ever sent without likewise updating waittimeout.
The basic command string used does this (note this is after setting t.count() to 10:
ping '8.8.8.8' -q -w 1 -c 10 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 41.559/41.559/41.559/0.000 ms
Because the waittime is set to 1 second, ping exits after 1 second regardless of the count passed.
Even moving the options around causes this to happen, as -w will always trigger ping to exit regardless of how many -c packets ahve been transmitted:
ping '8.8.8.8' -c 10 -q -w 1 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms
However, changing the wattime to something else allows ping to do what it is supposed to do: ping '8.8.8.8' -c 10 -q -w 10 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics --- 10 packets transmitted, 8 received, 20% packet loss, time 9025ms rtt min/avg/max/mdev = 40.577/61.105/115.968/25.518 ms
As does dropping the -w completely