pub struct AsyncPinger { /* private fields */ }Expand description
A pinger that does not block when sending.
Implementations§
Source§impl AsyncPinger
impl AsyncPinger
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new AsyncPinger. Creating one or more AsyncPingers will spawn a single dedicated thread which handles all async IO for all AsyncPingers. If ICMP handle initialization fails, all ping requests will return an error.
§Panics
This may panic if the compile-time environment variable WINPING_ASYNC_BUFFER_SIZE
is set but cannot be parsed to a valid usize
Sourcepub fn set_timeout(&mut self, timeout: u32)
pub fn set_timeout(&mut self, timeout: u32)
Sets the timeout, in milliseconds, for future requests.
Sourcepub fn send4(&self, dst: Ipv4Addr, buf: Buffer) -> PingFuture ⓘ
pub fn send4(&self, dst: Ipv4Addr, buf: Buffer) -> PingFuture ⓘ
Send an ICMPv4 request to the destination address. On success, returns the round trip time in milliseconds.
Sourcepub fn send4_from(
&self,
src: Ipv4Addr,
dst: Ipv4Addr,
buf: Buffer,
) -> PingFuture ⓘ
pub fn send4_from( &self, src: Ipv4Addr, dst: Ipv4Addr, buf: Buffer, ) -> PingFuture ⓘ
Sends an ICMPv4 request from the source address to the destination address. On success, returns the round trip time in milliseconds.
Sourcepub fn send6(&self, dst: Ipv6Addr, buf: Buffer) -> PingFuture ⓘ
pub fn send6(&self, dst: Ipv6Addr, buf: Buffer) -> PingFuture ⓘ
Sends an ICMPv6 request to the destination address. On success, returns the round trip time in milliseconds.
Sourcepub fn send6_from(
&self,
src: Ipv6Addr,
dst: Ipv6Addr,
buf: Buffer,
) -> PingFuture ⓘ
pub fn send6_from( &self, src: Ipv6Addr, dst: Ipv6Addr, buf: Buffer, ) -> PingFuture ⓘ
Sends an ICMPv6 request from the source address to the destination address. On success, returns the round trip time in milliseconds.