import socket HOST = "10.128.0.15" # Standard loopback interface address (localhost) PORT = 5013 # Port to listen on (non-privileged ports are > 1023) initialized =0 with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind((HOST, PORT)) s.listen(1) conn, addr = s.accept() with conn: print(f"Connected by {addr}") if initialized == 0: initialized = 1 conn.send('\x01'.encode('utf-8')) while True: data = conn.recv(1024).decode() print(data) if not data: break conn.sendall(data)