标签:connect 网络编程 tcp serve name sel print server ever
1.导入socketserver,ThreadingTCPServer支持多client连接import socketserver
class Mysocket(socketserver.BaseRequestHandler):
def handle(self):
while True:
try:
pass
except ConnectionResetError as e:
print(e)
if __name__=="__main__":
Host,port=‘localhost‘,8989
server=socketserver.ThreadingTCPServer((Host, port), Mysocket)
server.serve_forever()
标签:connect 网络编程 tcp serve name sel print server ever
原文地址:http://blog.51cto.com/13803166/2133041