Select - příklad import socket, select HOST = PORT = 55555 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((HOST, PORT)) s.listen(1) while 1: conn, addr = s.accept() print Connection from , addr conn.send( Login: ) rd, wr, er = select.select([conn], [], [], 5) if rd: user = conn.recv(1024) print User: , user conn.send( OK\r\n ) else: print Timeout conn.send( Sorry...
{}