8.2. Transmitter classes¶
- class pingparsing.PingTransmitter[source]¶
Transmitter class to send ICMP packets by using the OS built-in
ping
command.- count: int | None = None¶
Number of sending ICMP packets. This attribute will be ignored if the value is
None
.
- interface: str | None = None¶
Interface name or zone-id. The attribute required when
destination
is IPv6 link-local scope address.
- timestamp: bool = False¶
[Only for Linux environment] If
True
, add a timestamp for each ping result. Defaults toFalse
.
- auto_codepage: bool = True¶
[Only for Windows environment] Automatically change the code page if
True
. Defaults toTrue
.
- property deadline: Time | None¶
Timeout before ping exits. You can specify either a number or a string (e.g.
"1sec"
). If only a number is specified and a unit is not found, the unit will be considered as seconds.Unit
Available specifiers (str)
days
d
/day
/days
hours
h
/hour
/hours
minutes
m
/min
/mins
/minute
/minutes
seconds
s
/sec
/secs
/second
/seconds
milliseconds
ms
/msec
/msecs
/millisecond
/milliseconds
microseconds
us
/usec
/usecs
/microsecond
/microseconds
If both
deadline
andcount
areNone
,deadline
is automatically set to the default value (3 seconds
). Defaults toNone
.- Returns:
deadline
- Return type:
humanreadable.Time
- property destination_host: str¶
Alias to
destination
- ping() PingResult [source]¶
Sending ICMP packets.
- Returns:
ping
command execution result.- Return type:
- Raises:
ValueError – If parameters are not valid.
- property timeout: Time | None¶
Time to wait for a response per packet. You can specify either a number or a string (e.g.
"1sec"
). If only a number is specified and a unit is not found, the unit will be considered as seconds.Unit
Available specifiers (str)
days
d
/day
/days
hours
h
/hour
/hours
minutes
m
/min
/mins
/minute
/minutes
seconds
s
/sec
/secs
/second
/seconds
milliseconds
ms
/msec
/msecs
/millisecond
/milliseconds
microseconds
us
/usec
/usecs
/microsecond
/microseconds
Use system default timeout if the value is
None
. Defaults toNone
. If the system does not support timeout in milliseconds, round up as seconds.- Returns:
timeout
- Return type:
humanreadable.Time