From f396ba038ee5a1136d8bb28657cbc1f28725be00 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 10 Oct 2024 14:27:40 +0200 Subject: [PATCH] Better echo server --- echo_server/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/echo_server/src/main.rs b/echo_server/src/main.rs index cf082df..88a0861 100644 --- a/echo_server/src/main.rs +++ b/echo_server/src/main.rs @@ -19,8 +19,10 @@ fn main() { } else { eprintln!("Responded."); } + } else if msg.is_close() { + eprintln!("Connection closed."); } else { - eprintln!("Message received not text or binary."); + eprintln!("Unknown message received: {msg:?}"); } } eprintln!("Client left.");