X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Fns3%2Fns3server.py;h=8b3cd79a6a28ee7b0a8be68a9c66283958c83700;hb=6285ca51026efb69642eea9dfc7c480e722d84a9;hp=5f756ae66f6ee40daa2f286ee2d045572014a4bb;hpb=4762aa96c7f41a86d919db6dac0feca2c6ca8e16;p=nepi.git diff --git a/src/nepi/resources/ns3/ns3server.py b/src/nepi/resources/ns3/ns3server.py index 5f756ae6..8b3cd79a 100644 --- a/src/nepi/resources/ns3/ns3server.py +++ b/src/nepi/resources/ns3/ns3server.py @@ -3,9 +3,8 @@ # Copyright (C) 2014 INRIA # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -116,7 +115,7 @@ def recv_msg(conn): while '\n' not in chunk: try: chunk = conn.recv(1024) - except (OSError, socket.error), e: + except (OSError, socket.error) as e: if e[0] != errno.EINTR: raise # Ignore eintr errors @@ -203,11 +202,11 @@ def run_server(socket_name, level = logging.INFO, ns_log = None, while not stop: conn, addr = sock.accept() - conn.settimeout(5) + conn.settimeout(30) try: (msg_type, args, kwargs) = recv_msg(conn) - except socket.timeout, e: + except socket.timeout as e: # Ingore time-out close_socket(conn) continue