Skip to content

Instantly share code, notes, and snippets.

use std::io::{Read, Write};
use std::net::TcpListener;
fn main() {
let listener = TcpListener::bind("127.0.0.1:8080").unwrap();
for stream in listener.incoming() {
let mut stream = stream.unwrap();
std::thread::spawn(move || loop {
let mut buf = [0 as u8; 1024];