<html><head><base href="x-msg://350/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 7, 2012, at 9:04 PM, Peng Xiao -X (penxiao - Digital China at Cisco) wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="ZH-CN" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: justify; font-size: 10.5pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Hi experts,<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: justify; font-size: 10.5pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p>&nbsp;</o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: justify; font-size: 10.5pt; font-family: Calibri, sans-serif; "><span lang="EN-US">I have one twisted program, and it used to connected some servers through reactor.connectTCP(),<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: justify; font-size: 10.5pt; font-family: Calibri, sans-serif; "><span lang="EN-US">And now,<span class="Apple-converted-space">&nbsp;</span><span style="color: red; ">when the program is running</span>, I want to add another connection or disconnect one connection already has through reactor.connectTCP(), how can I do that?<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: justify; font-size: 10.5pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p>&nbsp;</o:p></span></div></div></div></span></blockquote><div><br></div><div>Call reactor.connectTCP() again to make a new connection. &nbsp;This works at any time, not just before the reactor is run.</div><div><br></div><div>Call self.transport.loseConnection() to terminate a connection from within a Protocol class.</div><div><br></div><div>-glyph</div><div><br></div></div><br></body></html>