A simple, non-blocking TCP server written in C++ using epoll.
This project implements a lightweight event-driven TCP server. Currently, it functions as an echo server that reads incoming data from connected clients and immediately writes it back out.
src/main.cpp: Entry point of the server.src/server.h/src/server.cpp: Contains theServerclass which manages client connections and theepollevent loop.src/client.h: Defines theClientStatestructure for tracking read/write buffers of connected clients.src/utils.h/src/utils.cpp: Contains utility functions such asset_nonblocking.
A Makefile is provided to build the project using g++ (requires C++17 support).
makeThe executable will be located at build/resp-server.
./build/resp-serverThe server will listen for TCP connections on port 6380.
You can test the server using netcat:
nc localhost 6380- beej guide for network programming to understand what each thing does if you are new to socket programming in c++ or c link -> https://beej.us/guide/bgnet/html/split-wide/index.html