Websocket Server online check modification

This is in place, in the hopes to prevent a false "Server unreachable"
error, created by a random int is not be iterated. Will be revisited
once this elusive error is resolved.
This commit is contained in:
angelblue05 2015-05-29 16:42:19 -05:00
parent 6a0b9a4934
commit 795430daff

View file

@ -307,7 +307,13 @@ class WebSocketThread(threading.Thread):
#raise #raise
def on_close(self, ws): def on_close(self, ws):
WINDOW = self.WINDOW
self.logMsg("Closed", 2) self.logMsg("Closed", 2)
# Server is not online
if WINDOW.getProperty("Server_online") == "true":
self.logMsg("Server is unreachable.", 1)
WINDOW.setProperty("Server_online", "false")
xbmcgui.Dialog().notification("Error connecting", "%s Server is unreachable." % self.addonName)
def on_open(self, ws): def on_open(self, ws):
pass pass
@ -348,14 +354,9 @@ class WebSocketThread(threading.Thread):
self.client.run_forever() self.client.run_forever()
if (self.keepRunning): if (self.keepRunning):
# Server is not online
if WINDOW.getProperty("Server_online") == "true":
self.logMsg("Server is unreachable.", 1)
WINDOW.setProperty("Server_online", "false")
xbmcgui.Dialog().notification("Error connecting", "%s Server is unreachable." % self.addonName)
if self.KodiMonitor.waitForAbort(5): if self.KodiMonitor.waitForAbort(5):
break break
else: break
self.logMsg("Thread Exited") self.logMsg("Thread Exited")