MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / main

Function main

ch_01/minimal-tcp/src/main.rs:3–9  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1use std::{io::prelude::*, net::{TcpStream, TcpListener}};
2
3fn main() {
4 let listener = TcpListener::bind("127.0.0.1:8080").unwrap();
5 for stream in listener.incoming() {
6 let stream = stream.unwrap();
7 handle_stream(stream);
8 }
9}
10
11fn handle_stream(mut stream: TcpStream) {
12 let mut buffer = [0; 1024];

Callers

nothing calls this directly

Calls 1

handle_streamFunction · 0.85

Tested by

no test coverage detected