Skip to content

Instantly share code, notes, and snippets.

@dorentus

dorentus/demo.rs Secret

Created March 28, 2022 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dorentus/69eec5806858c6f1e9cf5b85930e9d81 to your computer and use it in GitHub Desktop.
Save dorentus/69eec5806858c6f1e9cf5b85930e9d81 to your computer and use it in GitHub Desktop.
demo.rs
fn serv(host: &str, port: u16) {
let server = match std::net::TcpListener::bind(format!("{}:{}", host, port)) {
Err(error) => {
println!("{}", error);
return;
}
Ok(server) => server,
};
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment