Another possible fix for server issues.

This commit is contained in:
blitzmann
2015-10-30 21:07:56 -04:00
parent 6eafbb0a25
commit 649b99d7bd
2 changed files with 15 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ import threading
import copy
import uuid
import wx
import time
from wx.lib.pubsub import pub
@@ -112,6 +113,7 @@ class Crest():
logging.debug("Starting server")
if self.httpd:
self.stopServer()
time.sleep(1) # we need this to ensure that the previous get_request finishes, and then the socket will close
self.httpd = service.StoppableHTTPServer(('', 6461), service.AuthHandler)
thread.start_new_thread(self.httpd.serve, ())