Skip to content

A learning project covering various concepts: socket programming (UDP, TCP), multithreading, mutexes, and condition variables

Notifications You must be signed in to change notification settings

NguyenHiu/Chat-Room

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat Room

This project is a learning exercise to understand and implement a chat room application using C++. It covers various concepts such as socket programming (TCP and UDP), multi-threading, mutexes, and condition variables.

Features

  • Create and join chat rooms.
  • Two types of clients: Watcher (can only see chat history) and Sender (can only send messages).
  • Multi-threaded server to handle multiple clients concurrently.
  • Use of mutexes and condition variables to manage shared resources.

Getting Started

Prerequisites

  • C++ compiler (e.g., g++)
  • Make
  • ncurses library

Building the Project

To build the project, run the following command:

make

This will compile the server and client executables and place them in the build directory.

Running the Server

To start the server, run the following command:

./build/server

The server will start and create a default chat room.

Running the Client

To start the client, run the following command:

./build/client

The client will start and display a menu to create or join a chat room.

Demo

Chat Room Demo

About

A learning project covering various concepts: socket programming (UDP, TCP), multithreading, mutexes, and condition variables

Topics

Resources

Stars

Watchers

Forks