issue:
when restarting plugin it takes about 15 seconds before the open works again, .
(12345 is the port# used)
open:
- Code: Select all
socketServer = ThreadedTCPServer((192.168.1.x,12345), ThreadedTCPRequestHandler)
/usr/sbin/lsof -i tcp:12345
shows nothing open
as soon as /usr/sbin/lsof -i tcp:12345 shows a port (that takes 15 seconds)
- Code: Select all
TCPserverHandle = threading.Thread(target=socketServer.serve_forever)
TCPserverHandle.daemon =True # don't hang on exit
TCPserverHandle.start()
closing is done like this at the end of plugin works w/o problem:
- Code: Select all
if self.socketServer is not None:
self.socketServer.shutdown()
self.socketServer.server_close()
indigo.server.log( u"stopped tcpip stack")
Also works when the plugin is disabled and then enabled, but when plugin gets restarted (by itself).. looks like there is still something open, but not visible and it takes OSX ~ 15 secs to finally close the socket.
==> is there anything that can be done to force a close ie give some parameters to elf.socketServer.shutdown()
tried
- Code: Select all
self.socketServer.shutdown(socket.SHUT_RDWR)
Karl