From 39183b7885d8204054c4d03c4df29825a8a605fa Mon Sep 17 00:00:00 2001 From: omagdy Date: Tue, 15 Jul 2025 00:51:33 +0300 Subject: test respond to PING --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 31ffadc..20ceccd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,13 @@ #![allow(unused_imports)] -use std::net::TcpListener; +use std::{io::Write, net::TcpListener}; fn main() { let listener = TcpListener::bind("127.0.0.1:6379").unwrap(); for stream in listener.incoming() { match stream { - Ok(_stream) => { - println!("accepted new connection"); + Ok(mut stream) => { + stream.write_all(b"+PONG\r\n").unwrap(); } Err(e) => { println!("error: {}", e); -- cgit v1.2.3