ChatRoom-CPP is a simple chat room application that allows multiple clients to connect to a server and exchange messages in real-time. The application is built using C++ and utilizes the Boost.Asio library for asynchronous networking.
ChatRoom-CPP
├── src
│ ├── chatroom.cpp
│ └── client.cpp
├── include
│ ├── chatroom.hpp
│ └── message.hpp
├── CMakeLists.txt
├── .gitignore
└── README.md
- src/chatroom.cpp: Contains the implementation of the
Room
andSession
classes, which manage participants and message delivery in a chat room. - src/client.cpp: Implements the client-side functionality for connecting to the chat room server, handling asynchronous reading and sending of messages.
- include/chatroom.hpp: Declares the
Participant
,Room
, andSession
classes, defining the interface for participants and chat room management. - include/message.hpp: Declares the
Message
class, which handles message encoding and decoding. - CMakeLists.txt: Configuration file for CMake, specifying project details and dependencies.
- .gitignore: Specifies files and directories to be ignored by Git.
- README.md: Documentation for the project.
-
Clone the repository:
git clone <repository-url> cd ChatRoom-CPP
-
Create a build directory:
mkdir build cd build
-
Run CMake to configure the project:
cmake ..
-
Build the project:
cmake --build .
-
Start the server:
./chatroom <port>
-
Connect a client:
./client <port>
-
Enter messages in the client console to send them to the chat room.
This project requires the Boost.Asio library. Please ensure that it is installed on your system before building the project. You can install it using your package manager or by following the instructions on the Boost website.
This project is licensed under the MIT License. See the LICENSE file for more details.