aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoromagdy <omar.professional8777@gmail.com>2025-07-15 00:51:33 +0300
committeromagdy <omar.professional8777@gmail.com>2025-07-15 00:51:33 +0300
commit39183b7885d8204054c4d03c4df29825a8a605fa (patch)
tree8149617c6b2083eb2f0719e8912114634b82f173 /src
parentf2192f63370287ecfea666d70e368235f0dc33bb (diff)
downloadredis-rust-39183b7885d8204054c4d03c4df29825a8a605fa.tar.xz
redis-rust-39183b7885d8204054c4d03c4df29825a8a605fa.zip
test respond to PING
Diffstat (limited to 'src')
-rw-r--r--src/main.rs6
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);