()
| 3 | |
| 4 | #[wstd::main] |
| 5 | async fn main() -> io::Result<()> { |
| 6 | let mut args = std::env::args(); |
| 7 | |
| 8 | let _ = args.next(); |
| 9 | |
| 10 | let addr = args.next().ok_or_else(|| { |
| 11 | io::Error::new( |
| 12 | std::io::ErrorKind::InvalidInput, |
| 13 | "address argument required", |
| 14 | ) |
| 15 | })?; |
| 16 | |
| 17 | let mut stream = TcpStream::connect(addr).await?; |
| 18 | |
| 19 | stream.write_all(b"ping\n").await?; |
| 20 | |
| 21 | let mut reply = Vec::new(); |
| 22 | stream.read_to_end(&mut reply).await?; |
| 23 | |
| 24 | Ok(()) |
| 25 | } |
nothing calls this directly
no test coverage detected