File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ const net = require("net");
22
33const server = net . createServer ( ( connection ) => {
44 // Handle connection
5- connection . write ( `+PONG\r\n` ) ;
5+ connection . on ( "data" , ( data ) => {
6+ connection . write ( `+PONG\r\n` ) ;
7+ } ) ;
68} ) ;
79
810server . listen ( 6379 , "127.0.0.1" ) ;
Original file line number Diff line number Diff line change 1- @@ -1,7 +1,8 @@
1+ @@ -1,7 +1,10 @@
22 const net = require("net");
33
44 const server = net.createServer((connection) => {
55 // Handle connection
6- + connection.write(`+PONG\r\n`);
6+ + connection.on("data", (data) => {
7+ + connection.write(`+PONG\r\n`);
8+ + });
79 });
810
911 server.listen(6379, "127.0.0.1");
Original file line number Diff line number Diff line change 11import * as net from "net" ;
2+ import { Buffer } from "buffer" ;
23
34const server : net . Server = net . createServer ( ( connection : net . Socket ) => {
45 // Handle connection
5- connection . write ( `+PONG\r\n` ) ;
6+ connection . on ( "data" , ( data : Buffer ) => {
7+ connection . write ( `+PONG\r\n` ) ;
8+ } ) ;
69} ) ;
710
811server . listen ( 6379 , "127.0.0.1" ) ;
Original file line number Diff line number Diff line change 1- @@ -1,7 +1,8 @@
1+ @@ -1,7 +1,11 @@
22 import * as net from "net";
3+ + import { Buffer } from "buffer";
34
45 const server: net.Server = net.createServer((connection: net.Socket) => {
56 // Handle connection
6- + connection.write(`+PONG\r\n`);
7+ + connection.on("data", (data: Buffer) => {
8+ + connection.write(`+PONG\r\n`);
9+ + });
710 });
811
912 server.listen(6379, "127.0.0.1");
You can’t perform that action at this time.
0 commit comments