Source code at Github
The server utilizes eventpoll system calls to be able to handle multiple clients the FD for server and each client is set to be nonblocking using fcntl then added to epoll instance then we accept new connections or commands through the ready epoll objects
In sequence
Read client data-> Parse commands -> Dispatch the arguments to command table -> Process command ->Write response
PING
ECHO {value}
SET key value
GET key
#compile
gcc *.c -o main
#run server
./main
#connect to the server
nc localhost 6379
PING
#the server should respond with +PONG
Replace epoll with select or IOCP
Replace POSIX calls with Winsock
Add WSAStartup
Change nonblocking setu