#2 tcp listener
This commit is contained in:
parent
d125f80ebc
commit
6b5980cac2
1 changed files with 7 additions and 1 deletions
|
|
@ -1,3 +1,9 @@
|
||||||
|
use std::net::TcpListener;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
let listener = TcpListener::bind("127.0.0.1:7878").unwrap();
|
||||||
|
for stream in listener.incoming() {
|
||||||
|
let stream = stream.unwrap();
|
||||||
|
println!("Connection established!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue