i made a simple server/client program: Mano Vardas / tcp-hello-world · GitLab
the server handles a client at a time. the client just reads all data from the server until the server disconnects, then prints it to the command line. If you want to handle multiple clients at a time you would need to spawn a thread for each one, that is because when reading from a TcpStream the current thread gets “locked up” (blocked) and you can’t do anything else on it (like processing messages from other clients).
you start the server with
cargo run --bin tcp-hello-world-server and the client with
cargo run --bin tcp-hello-world-client