Reputation: 25
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?
Upvotes: 1
Views: 84
Reputation: 31860
No, it doesn't.
If you want to close all the connections, you will have to maintain a list of the transports created.
Upvotes: 1