<div><div class="gmail_quote">On Thu, Aug 11, 2011 at 5:13 PM, Tobias Oberstein <span dir="ltr">&lt;<a href="mailto:tobias.oberstein@tavendo.de">tobias.oberstein@tavendo.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">




<div>
<font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt">For a test driver for a TCP-based protocol (written in Twisted) I want to send data to a<br>
receiver as fast as the receiver can consume data, but not faster.<br>
<br>
Apparently, a naive loop which just does transport.write() does not work. When I do<br>
reactor.select(0) between the writes, it somehow works, but memory consumption<br>
of sender is growing fast, since I guess data is buffered within Twisted, right?<br>
<br>
I then got over implementing my own application level flow control, where the<br>
receiver gives feedback of how much it has consumed, and the sender throttles<br>
itself to that.<br>
<br>
However, isn&#39;t there a simpler way (without application level flow control)?<br>
<br>
In the end, the sender TCP stack must have knowledge of it&#39;s window size ..<br>
is there a way to get at that info?<br>
<br>
What is the recommended way?</span></font></div></blockquote><div><br></div><div><br></div><div>You want to write a producer:<div><br></div><div><a href="http://twistedmatrix.com/documents/current/core/howto/producers.html">http://twistedmatrix.com/documents/current/core/howto/producers.html</a></div>
</div><div> </div><div><br></div><div><br></div><div><br></div></div><br>-- <br>Christopher Armstrong<br><a href="http://radix.twistedmatrix.com/">http://radix.twistedmatrix.com/</a><br><a href="http://planet-if.com/">http://planet-if.com/</a><br>
<br><br>
</div>