home · contact · privacy
Re-try on TimeoutError on socket connect.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 17 Apr 2016 08:31:23 +0000 (10:31 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 17 Apr 2016 08:31:23 +0000 (10:31 +0200)
plomlombot.py

index cde978a1f2fb063ede7ba05d9add76d7aa1713f5..61da87140fca80d902042d933b0b235fe25dcd0c 100755 (executable)
@@ -53,7 +53,10 @@ class IO:
     def __init__(self, server, port, timeout):
         self.timeout = timeout
         self.socket = socket.socket()
     def __init__(self, server, port, timeout):
         self.timeout = timeout
         self.socket = socket.socket()
-        self.socket.connect((server, port))
+        try:
+            self.socket.connect((server, port))
+        except TimeoutError:
+            raise ExceptionForRestart
         self.socket.setblocking(0)
         self.line_buffer = []
         self.rune_buffer = ""
         self.socket.setblocking(0)
         self.line_buffer = []
         self.rune_buffer = ""