Companion: handle timeout while connecting
This commit is contained in:
parent
c20c701abd
commit
b9016a0acd
1 changed files with 10 additions and 2 deletions
|
@ -130,8 +130,17 @@ class WebSocket(threading.Thread):
|
||||||
timeout=1,
|
timeout=1,
|
||||||
sslopt=sslopt,
|
sslopt=sslopt,
|
||||||
enable_multithread=True)
|
enable_multithread=True)
|
||||||
except (IOError):
|
except IOError:
|
||||||
log("Error connecting", 0)
|
log("Error connecting", 0)
|
||||||
|
self.ws = None
|
||||||
|
xbmc.sleep(1000)
|
||||||
|
except websocket.WebSocketTimeoutException:
|
||||||
|
log("timeout while connecting, trying again", 0)
|
||||||
|
self.ws = None
|
||||||
|
xbmc.sleep(1000)
|
||||||
|
except Exception as e:
|
||||||
|
log("Unknown exception encountered in connecting: %s" % e)
|
||||||
|
self.ws = None
|
||||||
xbmc.sleep(1000)
|
xbmc.sleep(1000)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log("Unknown exception encountered: %s" % e)
|
log("Unknown exception encountered: %s" % e)
|
||||||
|
@ -140,7 +149,6 @@ class WebSocket(threading.Thread):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
self.ws = None
|
self.ws = None
|
||||||
pass
|
|
||||||
|
|
||||||
log("##===---- WebSocketClient Stopped ----===##", 0)
|
log("##===---- WebSocketClient Stopped ----===##", 0)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue