FTP implemented using an improved version of UDP
- Set the variables
CLIENT_IP
andSERVER_IP
insrc/client.py
andsrc/server.py
- Specify the path to the file to be delivered in
src/server.py
. This file should be place in thedata
directory
data_file = open(os.path.join(HOME_DIR,'data','---filename--'), 'rb')
- Note that the file to be delivered must be of a 'bytestring' format, since this is the format that is written by the client script. This allows for reliable comparison of the received file with the original
- First run the client script on the receiving system, and then the server script on the sending system. The client script will terminate when the file transfer is completed, and then the server script will exit when it no longer detects a connection with the client script
user@client_ip:~/custom-ftp$ python3 src/client.py
user@server_ip:~/custom-ftp$ python3 src/server.py
- The variables
DATA_SIZE
andtransmission_rate
insrc/server.py
, and the socket timeout insrc/client.py
can be tuned to suit different use cases and network conditions