I have a python script that runs constantly, listening for TCP connections. I would like to close all connections at the end of each day.
I create my services with:
rendererService = internet.TCPServer(1945,f.getFactory(Renderer))
rendererService.setServiceParent(serviceCollection)
Every new Renderer is also referenced in a dictionary that is initiated at startup: renderers
To close all connections, I schedule it to run:
rendererService.disownServiceParent()
renderers = {}
Will this guarantee that all connections are shutdown and all objects are destroyed, even if they were in the progress of receiving/sending data?
Will it wait for the data transmission/reception to end before closing?
No, it doesn’t.
If you want to close all the connections, you will have to maintain a list of the transports created.