user1549769
user1549769

Reputation: 25

Does Twisted disownServiceParent delete all active connections

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

Answers (1)

Glyph
Glyph

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

Related Questions