import socketserver class MyServer(socketserver.BaseRequestHandler): def handle(self): # 业务逻辑 server = socketserver.ThreadingTCPServer(('127.0.0.1',8088),MyServer) server.serve_forever()