Last active
October 28, 2015 19:06
-
-
Save skade/6ad1c238ba439d77626c to your computer and use it in GitHub Desktop.
function_to_copy
This file contains 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::net::{TcpListener, TcpStream}; | |
use std::io::BufReader; | |
use std::io::BufRead; | |
use std::io::Write; | |
fn read_message(stream: &mut TcpStream) -> String { | |
let mut read_buffer = String::new(); | |
let mut buffered_stream = BufReader::new(stream); | |
let res = buffered_stream.read_line(&mut read_buffer); | |
res.ok().expect("An error occured while reading!"); | |
read_buffer | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment