Allowing multiple Beremiz_service instances to run on same target.
authorlaurent
Thu, 08 Oct 2009 11:04:06 +0200
changeset 409 63249a965feb
parent 408 6eaa1908507d
child 410 092e33606e51
Allowing multiple Beremiz_service instances to run on same target.
Beremiz_service.py
--- a/Beremiz_service.py	Thu Oct 08 11:01:19 2009 +0200
+++ b/Beremiz_service.py	Thu Oct 08 11:04:06 2009 +0200
@@ -650,7 +650,15 @@
         reactor.registerWxApp(app)
     res = WebInterface()
     site = appserver.NevowSite(res)
-    reactor.listenTCP(8009, site)
+    
+    website_port = 8009
+    listening = False
+    while not listening:
+        try:
+            reactor.listenTCP(website_port, site)
+            listening = True
+        except:
+            website_port += 1
 else:
     res = None