2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 03:08:27 +08:00

comm_tcp: add connect timeout

This commit is contained in:
Sebastien Bourdeauducq 2015-08-28 16:23:23 +08:00
parent 241b7651a2
commit a36a50ba0d

View File

@ -32,7 +32,7 @@ class Comm(CommGeneric):
def open(self):
if hasattr(self, "socket"):
return
self.socket = socket.create_connection((self.host, self.port))
self.socket = socket.create_connection((self.host, self.port), 5.0)
set_keepalive(self.socket, 3, 2, 3)
logger.debug("connected to host %s on port %d", self.host, self.port)
self.write(b"ARTIQ coredev\n")