from socket import * host = "0.0.0.0" port = 2000 s = socket(AF_INET, SOCK_STREAM) s.bind((host,port)) s.listen(4) connections = [] while 1: connections.append(s.accept()) for i in connections: data = i[0].recv(1024) if data: i[0].send(data)