3C.Creation For File Transfer Using TCP Sockets: AIM Algorithm
3C.Creation For File Transfer Using TCP Sockets: AIM Algorithm
FILE_TRANSFER_USING_TCP_SOCKETS
HOST = '127.0.0.1'
PORT = 65432
filename = conn.recv(1024).decode('utf-8')
print(f"Client requested file: {filename}")
https://github.com/HIRU-VIRU/3c.FILE_TRANSFER_USING_TCP_SOCKETS 1/3
30/09/2024, 11:30 HIRU-VIRU/3c.FILE_TRANSFER_USING_TCP_SOCKETS
send_file(filename, conn)
client:
import socket
HOST = '127.0.0.1'
PORT = 65432
if response == 'EXISTS':
file_size = int(conn.recv(1024).decode('utf-8'))
print(f"File '{filename}' exists on server, size: {file_size} bytes.")
conn.sendall(b'READY')
receive_file(filename, client_socket)
OUTPUT:
server:
https://github.com/HIRU-VIRU/3c.FILE_TRANSFER_USING_TCP_SOCKETS 2/3
30/09/2024, 11:30 HIRU-VIRU/3c.FILE_TRANSFER_USING_TCP_SOCKETS
client:
RESULT
Thus, the python program for creating File Transfer using TCP Sockets Links was successfully
created and executed.
https://github.com/HIRU-VIRU/3c.FILE_TRANSFER_USING_TCP_SOCKETS 3/3