From a90d07cfb3923a38edcb3fc1f8b61ad750f72a9b Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 14 Sep 2016 11:59:47 -0500 Subject: Set a timeout on socket connections --- jobs/TCPServerChecker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'jobs/TCPServerChecker.py') diff --git a/jobs/TCPServerChecker.py b/jobs/TCPServerChecker.py index eaf6704..78ae1ac 100755 --- a/jobs/TCPServerChecker.py +++ b/jobs/TCPServerChecker.py @@ -31,6 +31,7 @@ class TCPServerChecker(JobSpawner.JobSpawner): def execute(self): try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.settimeout(5) s.connect((self.ip, self.port)) s.close() return True -- cgit v1.2.3