New Text Document
New Text Document
import threading
import time
# Final message
client_socket.sendall(b"All your files have been successfully copied.\n")
client_socket.sendall(b"ya3tik 3asba w taw ta5rali fih\n")
except Exception as e:
print(f"Error handling client {client_address}: {e}")
finally:
client_socket.close()
print(f"Connection with {client_address} closed.")
def main():
HOST = '' # Listen on all available interfaces
PORT = 1338 # Port to listen on
while True:
# Accept a connection
client_socket, client_address = server_socket.accept()