diff options
| author | omagdy <omar.professional8777@gmail.com> | 2025-07-15 00:51:33 +0300 |
|---|---|---|
| committer | omagdy <omar.professional8777@gmail.com> | 2025-07-15 00:51:33 +0300 |
| commit | 39183b7885d8204054c4d03c4df29825a8a605fa (patch) | |
| tree | 8149617c6b2083eb2f0719e8912114634b82f173 /src | |
| parent | f2192f63370287ecfea666d70e368235f0dc33bb (diff) | |
| download | redis-rust-39183b7885d8204054c4d03c4df29825a8a605fa.tar.xz redis-rust-39183b7885d8204054c4d03c4df29825a8a605fa.zip | |
test respond to PING
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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); |
