You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
phetch/src/main.rs

19 lines
443 B
Rust

#![allow(unused_must_use)]
use std::io::{Read, Write};
use std::net::TcpStream;
fn main() {
TcpStream::connect("phkt.io:70")
.and_then(|mut stream| {
stream.write("\r\n".as_ref()).unwrap();
let mut buf = String::new();
stream.read_to_string(&mut buf);
println!("{}", buf);
Ok(())
})
.map_err(|err| {
eprintln!("err: {}", err);
});
}