标签: python-3.x sockets
这是发送代码的客户端:
import socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) code=123 try: sock.connect(('192.168.1.10',12345)) sock.send(code) print(sock.recv(1024).decode('ascii')) finally: sock.close()