Created
May 16, 2020 15:59
-
-
Save ipcjk/385a8f09c2877f9f401fe7d456d09e0e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
use std::net::TcpStream; | |
fn main() { | |
for port in 0 .. 30 { | |
if let Ok(_) = TcpStream::connect(format!("{}:{}", "anyhost", port)) { | |
println!("{} open", port); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment