-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
Describe the bug
The ping() function can't be called with a large value for count. It will throw an error.
Setting count to a negative number does not result in an error (but it should).
Seems the count variable is ended up a signed 16-bit int for some reason.
To Reproduce
Steps to reproduce the behavior:
Large value error:
from pythonping import ping
ping('127.0.0.1', count=100000)
result: struct.error: short format requires (-32768) <= number <= 32767
Accept negative number:
from pythonping import ping
ping('127.0.0.1', count=-10)
result: Round Trip Times min/avg/max is 0/0/0 ms
Expected behavior
Expect to be able to set count to a positive int 0 .. sys.maxsize.
Large ping counts are helpful for long ping-flood tests to check for networking stability.
Expect error when setting count to a negative value.
Desktop (please complete the following information):
- OS: Windows 10
- Browser [e.g. chrome, safari]: n/a
- Version [e.g. 22]: python 3.10.6
BoboTiG
Metadata
Metadata
Assignees
Labels
No labels