File (1) 썸네일형 리스트형 [ RUST ] 웹 서버 만들기 ( 기초 ) use std::fs::File; use std::io::prelude::*; use std::net::TcpListener; use std::net::TcpStream; use std::path::Path; 표준 라이브러리 모듈을 가지고 온다. fn main() { let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); for stream in listener.incoming() { let stream = stream.unwrap(); handle_connection(stream); } } 7878포트에 들어오는 TCP 연결을 수락하고, 수락된 handle_connection 함수를 호출 해준다. fn handle_connection(mut stre.. 이전 1 다음