whos/raw.rs
1use std::io::{Read, Write};
2
3pub fn whois_raw(name: &str, server: (&str, u16)) -> std::io::Result<String> {
4 let mut stream = std::net::TcpStream::connect(server)?;
5 stream.write_all(name.as_bytes())?;
6 stream.write_all(b"\r\n")?;
7 let mut buf = String::new();
8 stream.read_to_string(&mut buf)?;
9 Ok(buf)
10}