Beremiz_service.py
changeset 409 63249a965feb
parent 396 d1083f580ca1
child 411 8261c8f1e365
equal deleted inserted replaced
408:6eaa1908507d 409:63249a965feb
   648         
   648         
   649     if havewx:
   649     if havewx:
   650         reactor.registerWxApp(app)
   650         reactor.registerWxApp(app)
   651     res = WebInterface()
   651     res = WebInterface()
   652     site = appserver.NevowSite(res)
   652     site = appserver.NevowSite(res)
   653     reactor.listenTCP(8009, site)
   653     
       
   654     website_port = 8009
       
   655     listening = False
       
   656     while not listening:
       
   657         try:
       
   658             reactor.listenTCP(website_port, site)
       
   659             listening = True
       
   660         except:
       
   661             website_port += 1
   654 else:
   662 else:
   655     res = None
   663     res = None
   656 
   664 
   657 if havewx:
   665 if havewx:
   658     from threading import Semaphore
   666     from threading import Semaphore