Skip to content

Instantly share code, notes, and snippets.

@idontcalculate
Created September 3, 2024 16:59
Show Gist options
  • Save idontcalculate/65ee3734a6ec4f07a46651308ac8de08 to your computer and use it in GitHub Desktop.
Save idontcalculate/65ee3734a6ec4f07a46651308ac8de08 to your computer and use it in GitHub Desktop.
#[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