mirror of https://github.com/KaiserY/trpl-zh-cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
238 B
12 lines
238 B
4 years ago
|
use std::net::TcpListener;
|
||
|
|
||
|
fn main() {
|
||
|
let listener = TcpListener::bind("127.0.0.1:7878").unwrap();
|
||
|
|
||
|
for stream in listener.incoming() {
|
||
|
let stream = stream.unwrap();
|
||
|
|
||
|
println!("Connection established!");
|
||
|
}
|
||
|
}
|