TCP client implemented in Python π in which the user can download files from a server. The server can be found in the following repository: https://github.com/juanesmendez/tcp-server. The app has a GUI, where the user can pick the file that he wishes to download. The app can simulate having more than one client connected at the same time to the server, in order to test how well the server performs under high demand, and how it can handle concurrency. The client checks the integrity of the file received by calculating a hash digest on the byte stream, and comparing it to the hash digest sent by the server in the header.
The following python libraries and classes were used in the client application:
socket
sys
πpickle
π₯: For deserializing objects containing byte chunks from the server and headers with important information that needs to be checked.hashlib
π#οΈβ£: For calculating the hash digest of the file that is transferred to the client.time
β³datetime
πthreading
concurrent.futures
tkinter
: Library that offers GUI components in Python π.random
In order to run the project successfully, you first have to download and run the server. which you can find it in the following repo: https://github.com/juanesmendez/tcp-server. Follow the instructions in the README.md in the repository to run the server successfully. After launching the server application, follow the instructions below:
- Download
Python 3.7
- Change line #16 in the
client.py
file with theIP address
of the computer where your server is running.- Example:
IP = "3.228.188.119"
- NOTE: You may change the
port
if you want in line #17. The default chosen by me was1236
. (Check that the server is running in the port you chose)
- Example:
- Run
python3.7 main.py
- Pick a file π to download from the dropdown, and enjoy!βοΈ The received file will be located in the
/files
folder. (Have in mind that you can only download files that are in theserver
project directory. Locate the files you want users to be able to download in the server first.)