aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 07777f17c64815d4c85ae02c9d49220703127ebb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::net::TcpListener;

fn main() {
    let listener = TcpListener::bind("127.0.0.1:4221").unwrap();

    for stream in listener.incoming() {
        match stream {
            Ok(_stream) => {
                println!("accepted new connection");
            }
            Err(e) => {
                println!("error: {}", e);
            }
        }
    }
}