标签:soc sock utf-8 2.3 imp close class port pre
import socket sk = socket.socket() sk.bind(("192.16.12.3",8088)) sk.listen() conn,addr = sk.accept() conn.send(b""/"".encode("utf-8")) ret = conn.recv(1024) print(ret.decode("utf-8")) conn.close() sk.close() import socket sk = socket.socket() sk.connect(("192.16.12.3",8088)) sk.send(b""/encode("utf-8")) ret = sk.recv(1024) print(ret.decode("utf-8")) sk.close()
标签:soc sock utf-8 2.3 imp close class port pre
原文地址:https://www.cnblogs.com/smile568968/p/9456954.html