<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 18, 2010, at 8:25 AM, Szabolcs Balogh wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: 'Bitstream Vera Sans Mono'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; 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; "><span class="Apple-style-span" style="font-family: monospace; ">Than how can I start checking for messages for different accounts (When I have<span class="Apple-converted-space">&nbsp;</span><br>finished checking the messages for the first account to start checking for the<span class="Apple-converted-space">&nbsp;</span><br>next account, and so on...)?<br></span></span></blockquote></div><br><div>The whole *point* of the "reactor" is to allow multiple connections (and timed calls) to be serviced simultaneously.</div><div><br></div><div>When you have "finished checking messages" for the first account, presumably there is a callback of some kind; most likely 'connectionLost()'. &nbsp;In connectionLost, you can just call connectTCP again with a protocol factory pointed at the second account.</div><div><br></div><div>This is actually a FAQ:</div><div><br></div><div>&lt;<a href="http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#HowdoImakeTwistedtalktomultipleclientsconnecttomultipleservers">http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#HowdoImakeTwistedtalktomultipleclientsconnecttomultipleservers</a>&gt;</div><div><br></div><div>Hopefully this helps.</div><div><br></div><div>This is a hard question to answer in a way where the next asker will actually find the answer, since the answer is really "just call a method", and the asker needs to understand that they can call any of these methods at any time. &nbsp;If you have any idea as to how the FAQ could be improved so that you might have found your answer while searching around, please let us know :). &nbsp;For example: the way you phrased your requirement here, "When I have done X, start doing X", even *sounds* like an event-driven program - 'def iHaveFinishedChecking(self): next.startChecking()' - so you were clearly on the right track. &nbsp;Why did you think you needed to run the reactor again in order to accomplish this?</div><div><br></div></body></html>