This project is a Chat Box application based on the Client-Server model.
It allows different users to communicate with each other using a shared Server.
The Protocols we used in this project are TCP and RDT-over-UDP.
In order to run the project on your machine please follow the instructions below:
Please make sure that next packages are installed in your Machine:
tkinter, pip, socket, threading, Path, _thread.
- How to install
tkinterlibrary on Ubunto 20.04:
sudo apt-get update
sudo apt install python3-tk - How to install
piplibrary on Ubuno 20.04:
sudo apt update
sudo apt install python3-pip
In this project we've defined a new Protocol for the Client-Server communication.
Prefix to Keys:
"m:message", "s:sender", "r:recipient", "t:request", "p:response", "q:sequence"
-
Connection to the Server:
Client: <s:'client_name'><r:server:server_IP><t:'connect'>
Server: <s:server:server_IP><r:'Client_name'><m:True/False><p:'connect_response'> -
Disconnection from the Server:
Client: <s:'client_name'><r:server:server_IP><t:'disconnect'>
Server: <s:server:server_IP><r:'Client_name'><m:True/False><p:'disconnect_response'> -
Users List:
Client: <s:'Client_name'><r:server:server_IP><t:'get_user_list'>
Server: <s:server_server_IP><r:'Client_name'><m:['user1','user2',...]><p:'user_list> -
Files List:
Client: <s:'Client_name'><r:server:server_IP><t:'get_file'>
Server: <s:server: server_IP><r:'Client_name'><m:['file1','file2',...]><p:'file_list'> -
Broadcast Message:
Client: <s:'Client_name'><r:'all'><t:'message_request'><m:'message info'>
Server: <s:server:server_IP><r:'Client_name'><m:True/False><p:'messagee_response'> -
Private Message:
Client: <s:'Client_name'><r:'Client2_name'><t:'message_request'><m:'message info'>
Server: <s:server:server_IP><r:'Client_name'><m:True/False><p:'messagee_response'> -
Messgae Received:
Server: <s:'sender_name'><r:receiver_name'><m:'message info'><p:'message_received'> -
Download a file:
Client: <s:'Client_name'><r:server:server_IP><t:'download'><m:'file name'>
Server: <s:server:server_IP><r:'Client_name'><m:'Port number'/'ERR'><p:'download_response'>- Open the Project folder and run the next command in the command line:
python src/server/server_main.py

- Press the option you wish to run and the Server will be up and running

- Open the Project folder and run the next command in the command line:
python src/client/client_main.py
- Login to the Server using the Server IP address and your Name
- Press the
Show Onlinebutton
- Press the
Show server filesButton
- Write your message in the
messageinput box. - press
sendwhen done.
- Write your message in the
messageinput box. - Write the name of the User you want to send the message to in the
Send toinput box. - Press
sendwhen done.
- Write the name of the file you wish to download in the
Servere file nameinput box. - Write a name for the file to be saved as in the
File name (Client save as)input box. - Press
Downloadwhen done. - In a while you will get a messaeg saying the file has been downloaded at 50%.
- Press
Proceedif you wish to countinue with the process. - Look up for a message saying the download process finished successfully.
- In order to see the messages in the Group Chat please Press the
Update screenbutton. - If nothing changes, there are no new messages to present.
- Press the
LogoutButton. - Wait for the 'Goodbye' message.
- Open the Project folder and run the next command in the command line: