A complete TCP echo server implementation using the loopp event loop library. Demonstrates connection handling, asynchronous I/O operations and graceful shutdown patterns.
-
Ensure CMake 3.10+ and C++23 compiler are installed.
-
Clone and navigate to the repository:
git clone https://github.com/nikijaz/loopp.git cd loopp/ -
Create a build directory and set up the project:
mkdir build && cd build cmake -DBUILD_EXAMPLES=ON ..
-
Build the echo server:
make
-
Run the echo server:
./examples/echo-server/echo-server & -
Connect using
telnetornetcat:telnet localhost 8080 # or nc localhost 8080
echo-server/
├── src/
│ ├── main.cpp // Entry point with signal handling and server configuration
│ ├── client.cpp // Individual client connection handler with buffered I/O
│ ├── client.hpp
│ ├── socket.cpp // Low-level socket wrapper for network operations
│ ├── socket.hpp
│ ├── tcp_server.cpp // High-level TCP server abstraction managing connections
│ └── tcp_server.hpp
└── CMakeLists.txt