Skip to content

Instantly share code, notes, and snippets.

View CHINMAYVIVEK's full-sized avatar
🏠
Working from home

CHINMAY VIVEK CHINMAYVIVEK

🏠
Working from home
View GitHub Profile
use std::net::{TcpStream, TcpListener};
use std::io::{Read, Write};
use std::thread;
fn handle_read(mut stream: &TcpStream) {
let mut buf = [0u8 ;4096];
match stream.read(&mut buf) {
Ok(_) => {
let req_str = String::from_utf8_lossy(&buf);