[Twisted-Python] How to Control Twisted Program through CLI

Glyph glyph at twistedmatrix.com
Tue Feb 7 22:49:04 EST 2012

On Feb 7, 2012, at 9:04 PM, Peng Xiao -X (penxiao - Digital China at Cisco) wrote:

> Hi experts,
> I have one twisted program, and it used to connected some servers through reactor.connectTCP(),
> And now, when the program is running, I want to add another connection or disconnect one connection already has through reactor.connectTCP(), how can I do that?

Call reactor.connectTCP() again to make a new connection.  This works at any time, not just before the reactor is run.

Call self.transport.loseConnection() to terminate a connection from within a Protocol class.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20120207/8d16f0bb/attachment.htm 

More information about the Twisted-Python mailing list