Ping Library
A comprehensive library for network connectivity testing using ICMP, UDP, and TCP protocols.
Features
- ICMP Ping: Traditional ping using ICMP echo requests
- UDP Ping: Connectivity testing using UDP packets with ICMP error responses
- TCP Ping: Connection-based testing using TCP handshakes
- Cross-platform: Works on Unix-like systems with appropriate permissions
- Async Support: Non-blocking operations for high-performance applications
Examples
Simple ICMP ping
use ;
use Ipv4Addr;
let config = PingConfig ;
let mut pinger = new?;
let results = pinger.ping_all?;
println!;
# Ok::
UDP connectivity test
use ;
use Ipv4Addr;
let config = PingConfig ;
let mut pinger = new?;
let reply = pinger.ping_once?;
println!;
# Ok::