<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">That is what I had thought. I had come up with a couple of possible options, some of them complex, but I wanted to make sure there wasn't anything hiding in twisted that was not obvious. Thanks.<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Christopher Armstrong &lt;radix@twistedmatrix.com&gt;<br>To: Twisted general discussion &lt;twisted-python@twistedmatrix.com&gt;<br>Sent: Friday, August 31, 2007 4:56:02 PM<br>Subject: Re: [Twisted-Python] Possible to delay connectTCP?<br><br>On 8/31/07, <b class="gmail_sendername">Beau Hargis</b> &lt;<a rel="nofollow" target="_blank" href="mailto:beau@subobscur.us">beau@subobscur.us</a>&gt;
 wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have an application which connects to a machine which has 50-60 ports open on it to receive data (each for a different region). It acts like a switch. Problem is that when I make all those connection requests at the same time the server falls over trying to handle all the connections requests from my application. I cannot control or change the behaviour of the server I am connecting to, however, I am also unable to find a way to easily to add a delay between connection requests in twisted (without blocking the reactor), so that only 2 or 3 start up at a time.
<br><br>Is there an elegant and clean way to do such a thing? Twisted has worked beautifully for everything else, but I can't replace this one server for a while until I can duplicate the rest of its functionality, so I am dependant on it providing the data.
</blockquote><div><br>The way to delay (that is, schedule) function calls until a later point in time is reactor.callLater(seconds, callable, *args, **kwargs).<br><br></div></div>-- <br>Christopher Armstrong<br>International Man of Twistery
<br><a rel="nofollow" target="_blank" href="http://radix.twistedmatrix.com/">http://radix.twistedmatrix.com/</a><br><a rel="nofollow" target="_blank" href="http://twistedmatrix.com/">http://twistedmatrix.com/</a><br><a rel="nofollow" target="_blank" href="http://canonical.com/">http://canonical.com/</a><br>
</div><br></div></div></body></html>