close Pyro socket after daemon stop
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 07 Dec 2016 17:54:41 +0300
changeset 1591 38e5f8847a45
parent 1590 cdf95900d44f
child 1592 c40355f450a5
close Pyro socket after daemon stop


without that socket port is open after daemon shutdown.
As a result if you restart daemon with new settings (service name, for example),
it can't listen on already used port and opens the next free TCP port
regardless of requested settings.
Beremiz_service.py
--- a/Beremiz_service.py	Wed Dec 07 17:51:20 2016 +0300
+++ b/Beremiz_service.py	Wed Dec 07 17:54:41 2016 +0300
@@ -417,6 +417,7 @@
         sys.stdout.flush()
 
         self.daemon.requestLoop()
+        self.daemon.sock.close()
 
     def Stop(self):
         if self.plcobj is not None: