Skip to content

A simple multithreaded chat application written in C++ using sockets (Linux & Windows). Supports multiple clients, colored messages, and clean console I/O.

Notifications You must be signed in to change notification settings

abubakar-abk1/chatroom-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

C++ Chat Application πŸ’¬

This is a lightweight, multithreaded chat application built in C++.
It supports both Linux (POSIX sockets) and Windows (Winsock2), allowing multiple clients to connect to a server and exchange messages in real time.

✨ Features

  • πŸ–§ Client-Server architecture using TCP sockets
  • 🎨 Colored messages for better readability
  • πŸ”„ Multithreaded: separate threads for sending and receiving
  • πŸ“‘ Works on Linux (<sys/socket.h>) and Windows (<winsock2.h>)
  • πŸ‘₯ Supports multiple clients simultaneously
  • #exit command to disconnect gracefully

πŸ› οΈ How to Run

On Linux:

  1. Run the following:
g++ server.cpp -o server -pthread
g++ client.cpp -o client -pthread
  1. Open a terminal and run the following(server):
./server
  1. For client open another terminal and run the following:
./client
  1. for multiple users repeat step 4.

On Windows:

  • Compile with MinGW or MSVC:
g++ client.cpp -o client.exe -lws2_32

πŸš€ Future Improvements

  • πŸ” User authentication (login system)
  • πŸ’¬ Private messages (DMs)
  • πŸ“‚ File sharing
  • πŸ–₯️ GUI version (Qt / ImGui)
image

About

A simple multithreaded chat application written in C++ using sockets (Linux & Windows). Supports multiple clients, colored messages, and clean console I/O.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages