Skip to content

This project implements a client-server communication system in C++ using TCP. It demonstrates key networking concepts such as data integrity, RTT and throughput calculation, and basic encryption/decryption. Designed for educational use in real-time communication.

Notifications You must be signed in to change notification settings

Mohamed-Magdy-Dewidar/Qt-WebSocket-Client-Server-Network-Communication-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qt WebSocket Client-Server Network Communication System

This project demonstrates a Client-Server network communication system using WebSockets in Qt C++. It showcases real-time communication between multiple clients and a central server through a GUI-based interface.


📌 Table of Contents


🧠 Overview

The goal of this project is to simulate a real-time chat system using WebSocket technology in the Qt framework. It consists of two exercises:

  • Exercise 2: Simple client-server communication
  • Exercise 3: Multiple clients communicating with a centralized server

✨ Features

  • Bi-directional communication using WebSockets
  • GUI for both server and clients
  • Broadcast messages to all connected clients
  • Proper connection handling and message dispatching
  • Real-time data exchange
  • RTT (Round Trip Time) and throughput measurement
  • Encrypted message transmission and integrity verification

🧱 System Architecture

System Architecture

The server listens for incoming WebSocket connections and relays messages from one client to all others in real time.
Each client is assigned a unique socket descriptor that defines the open channel between the server and the client.
The server uses a hash table where the client's assigned name (e.g., Client_1) is the key, and the corresponding socket descriptor is the value used for communication.


📸 Screenshots

Server GUI

Server GUI
The server listens on port 1234. When a client connects, it is assigned a name and a socket descriptor to keep the channel open for communication.

Client GUI

Client GUI
The client receives a welcome message along with its assigned name. It also displays metrics such as RTT and throughput, using a timestamp to measure the round-trip time from sending a request to receiving a response.

Server Receiving Data

Server GUI
The server receives encrypted messages from the client, decrypts them, and uses a hash to verify data integrity.

Client Disconnection

Client GUI
When the client presses the Disconnect button, the connection is terminated.

Server Notification

Server GUI
The server is notified when a client disconnects.


🚀 How to Run

Prerequisites

📥 Qt Installation

To build and run the project, you need to have Qt installed.

➡️ Download Qt

Make sure to install:

  • Qt 6.5+ (or compatible)
  • Desktop development tools
  • A suitable compiler (e.g., MinGW or MSVC)

During installation, configure the Qt version according to your system and ensure Qt Creator is included.

Steps To Run

  1. Clone the repository:
    git clone https://github.com/Mohamed-Magdy-Dewidar/Qt-WebSocket-Client-Server-Network-Communication-System.git
    cd Qt-WebSocket-Client-Server-Network-Communication-System

Open in Qt Creator:

Navigate to ex_2 folder (Client App)

Open the .pro file with Qt Creator and build it

Navigate to ex_3 folder (Server App)

Open the .pro file with Qt Creator and build it

Run the server first, then connect one or more clients.

⚠️ Note: If you receive an error when opening the .pro file, it’s likely due to a different Qt version. Just press OK and configure the project with your installed Qt version.

🛠️ Tools & Technologies Qt 6.8+ (Qt Widgets & WebSockets)

C++17

Qt Signal-Slot Mechanism

Git for version control

📬 Contact For inquiries or contributions, feel free to reach out via GitHub issues or fork the repo.

About

This project implements a client-server communication system in C++ using TCP. It demonstrates key networking concepts such as data integrity, RTT and throughput calculation, and basic encryption/decryption. Designed for educational use in real-time communication.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors