Created
September 3, 2024 16:59
-
-
Save idontcalculate/65ee3734a6ec4f07a46651308ac8de08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[tokio::main] | |
async fn main() -> Result<()> { | |
let addr = "127.0.0.1:8080".parse::<SocketAddr>().unwrap(); | |
let listener = TcpListener::bind(addr).await.unwrap(); | |
let mut ring = IoUring::new(256)?; | |
loop { | |
let (stream, _) = listener.accept().await?; | |
handle_client(stream, &mut ring).await?; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment