C++advancedbackendAI generated

Non-blocking Chat Server with epoll

A high-concurrency chat server using Linux epoll for non-blocking I/O multiplexing across thousands of client sockets in a single thread, broadcasting messages between connected clients. Learners practice epoll-based event loops, non-blocking socket programming, and efficient buffer management in C++.

Estimate
~12.5h
Steps
6
Completed by
0
Proposed by
codeseed.app

epoll · sys/socket.h

Project roadmap

  1. 01

    Set up the non-blocking listening socket

    ~1.5h

    Create a TCP socket set to non-blocking mode and register it with an epoll instance.

  2. 02

    Implement the epoll event loop

    ~2.5h

    Build the core loop calling epoll_wait and dispatching readable/writable events to handlers.

  3. 03

    Handle partial reads/writes with per-client buffers

    ~3h

    Maintain per-connection read/write buffers to correctly handle partial TCP reads and writes without blocking.

  4. 04

    Implement message broadcasting

    ~2h

    Parse complete messages from client buffers and queue them for writing to all other connected clients.

  5. 05

    Handle client disconnects and errors

    ~1.5h

    Detect EPOLLHUP/EPOLLERR and closed connections, cleaning up sockets and buffers safely.

  6. 06

    Load-test with many concurrent connections

    ~2h

    Write a test client script that opens many simultaneous connections to validate scalability.

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~12.5h · 6 steps

Tech stack

epollsys/socket.h