碰到新问题了,总是提示我缺少socket,请问是怎么回事?
你的sorket_server.py中 class TCPServer是否有错误?
正确代码如下:
def __init__(self, server_address, handler_class): self.server_address = server_address self.HandlerClass = handler_class # 处理请求的类 # 1. 创建套接字 self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # 协议类和类别, stream流 self.is_shutdown = False