Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Echo Server

A complete TCP echo server implementation using the loopp event loop library. Demonstrates connection handling, asynchronous I/O operations and graceful shutdown patterns.

Installation

  1. Ensure CMake 3.10+ and C++23 compiler are installed.

  2. Clone and navigate to the repository:

    git clone https://github.com/nikijaz/loopp.git
    cd loopp/
  3. Create a build directory and set up the project:

    mkdir build && cd build
    cmake -DBUILD_EXAMPLES=ON ..
  4. Build the echo server:

    make
  5. Run the echo server:

    ./examples/echo-server/echo-server &
  6. Connect using telnet or netcat:

    telnet localhost 8080
    # or
    nc localhost 8080

Code Structure

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