Skip to content

maniac0112/client_server_chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Client-Server Chat (C++ using select())

A lightweight multi-client chat server implemented in C++ using the POSIX select() and POLL() API. The server handles multiple client connections concurrently and supports real-time message broadcasting from the server console.


๐Ÿš€ Features

  • โœ… Supports multiple clients using a single-threaded select() and POLL() API.
  • โœ… Server can send messages to all connected clients via stdin
  • โœ… Thread-safe message queue using std::queue + std::mutex
  • โœ… Gracefully handles client disconnections
  • โœ… Uses low-level system calls: socket, bind, listen, accept, read, send, select

๐Ÿ› ๏ธ Build Instructions

Make sure you're compiling on a Unix-like system (Linux/macOS or WSL on Windows).

g++ -std=c++17 -pthread server.cpp -o chat_server

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages