STUDY/Network
TCP Echo Programming
TCP Echo Programming TCP_Socket_Server.py import socket HOST = "localhost" PORT = 1337 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) print("binding...") s.bind((HOST,PORT)) print("Success to bind") s.listen() print("Listen...") c, addr = s.accept() print("Connected by", addr) while True: data = c.recv(65536) if not data: break print("Received from", addr, data.decode()) c.sendall(data) c..
2020. 6. 26. 03:44