aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authoromagdy <omar.professional8777@gmail.com>2025-07-15 00:49:17 +0300
committeromagdy <omar.professional8777@gmail.com>2025-07-15 00:49:17 +0300
commitf2192f63370287ecfea666d70e368235f0dc33bb (patch)
tree92fc8f1c9cd0def8095f1d1fad117155388693bd /src/main.rs
parent6c099ac5bbbf789d570a5fa97a2da3cb5255fdf3 (diff)
downloadredis-rust-f2192f63370287ecfea666d70e368235f0dc33bb.tar.xz
redis-rust-f2192f63370287ecfea666d70e368235f0dc33bb.zip
test respond to PING
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/main.rs b/src/main.rs
index b200e70..31ffadc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,21 +2,16 @@
use std::net::TcpListener;
fn main() {
- // You can use print statements as follows for debugging, they'll be visible when running tests.
- println!("Logs from your program will appear here!");
+ let listener = TcpListener::bind("127.0.0.1:6379").unwrap();
- // Uncomment this block to pass the first stage
- //
- // let listener = TcpListener::bind("127.0.0.1:6379").unwrap();
- //
- // for stream in listener.incoming() {
- // match stream {
- // Ok(_stream) => {
- // println!("accepted new connection");
- // }
- // Err(e) => {
- // println!("error: {}", e);
- // }
- // }
- // }
+ for stream in listener.incoming() {
+ match stream {
+ Ok(_stream) => {
+ println!("accepted new connection");
+ }
+ Err(e) => {
+ println!("error: {}", e);
+ }
+ }
+ }
}