标签:ddr show list exception display col size stream img
recv是用户态的应用程序发起的
队列:是先进先出,吃了拉 队栈:是先进后出,吃了吐
输入空重新输入用continue
import socket phone=socket.socket(socket.AF_INET,socket.SOCK_STREAM) phone.bind((‘192.168.1.6‘,8002)) phone.listen(5) print(‘------>‘) while True: conn,addr=phone.accept() print(conn) print(addr) while True: try: msg=conn.recv(1024) print(type(msg)) print(‘来自客户端的消息‘,msg.decode(‘utf-8‘)) conn.send(msg.upper()) except Exception: break conn.close() phone.close()
标签:ddr show list exception display col size stream img
原文地址:https://www.cnblogs.com/jintian/p/10970799.html