I am interested in a “Hello World” level program that can do some text IO through a port - is there anything like this already around? - it would be a convenient thing for me to get started with that I could add to for an actual simple use case . .
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