moved to new bin folder

This commit is contained in:
Mitchell 2020-04-10 10:56:32 +00:00
parent 6b59c58098
commit f8a9c9a50b
1 changed files with 0 additions and 19 deletions

View File

@ -1,19 +0,0 @@
use std::net::TcpListener;
use std::net::TcpStream;
use std::io::prelude::*;
fn main(){
let listener = TcpListener::bind("127.0.0.1:6001").unwrap();
for stream in listener.incoming(){
let stream = stream.unwrap();
handle_connection(stream);
}
}
fn handle_connection(mut stream: TcpStream){
let mut buffer = [0; 512];
stream.read(&mut buffer).unwrap();
println!("Request: {}", String::from_utf8_lossy(&buffer[..]));
}