pub async fn pinger(host: IpAddr) -> Result<Pinger, SurgeError>
Expand description

Shortcut method to quickly make a Pinger. NOTE: This function creates a new internal Client on each call, and so should not be used if making many target. Create a Client instead.

Examples

let mut pinger = surge_ping::pinger("8.8.8.8".parse()?).await?;

Errors

This function fails if:

  • socket create failed