Created
January 28, 2019 10:59
-
-
Save spacejam/705944fb058453babf67fa77e6839e8a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::{Result, Read, Write}; | |
use std::net::{TcpListener, TcpStream}; | |
fn handle_client( | |
mut stream: TcpStream, | |
state: &mut Vec<String>, | |
) -> Result<()> { | |
Ok(()) | |
} | |
fn main() -> Result<()> { | |
let listener = TcpListener::bind("127.0.0.1:8000") | |
.expect("should be able to bind"); | |
let mut state = vec![]; | |
for socket in listener.incoming() { | |
handle_client(socket?, &mut state)?; | |
} | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment