diff --git a/Source/Server.rs b/Source/Server.rs index 6594520..bda4f94 100644 --- a/Source/Server.rs +++ b/Source/Server.rs @@ -9,7 +9,12 @@ async fn main() { loop { // The second item contains the IP and port of the new connection. let (socket, _) = listener.accept().await.unwrap(); - process(socket).await; + + // A new task is spawned for each inbound socket. The socket is + // moved to the new task and processed there. + tokio::spawn(async move { + process(socket).await; + }); } }