summaryrefslogtreecommitdiff
path: root/hello_server/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'hello_server/src/bin')
-rw-r--r--hello_server/src/bin/main.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/hello_server/src/bin/main.rs b/hello_server/src/bin/main.rs
index 522777a..bcf1e46 100644
--- a/hello_server/src/bin/main.rs
+++ b/hello_server/src/bin/main.rs
@@ -10,7 +10,7 @@ fn main() {
let listener = TcpListener::bind("127.0.0.1:7878").unwrap();
let pool = ThreadPool::new(4).unwrap();
- for stream in listener.incoming() {
+ for stream in listener.incoming().take(2) {
let stream = stream.unwrap();
pool.execute(|| {
@@ -18,6 +18,8 @@ fn main() {
});
}
+ println!("shutting down...");
+
}
fn handle_connection(mut stream: TcpStream) {