The proxy is not building up a queue, because {active, once} is set after every packet has been sent to the other side.<br>Streaming server keeps a close eye on the message queue and it does not allow it to grow by much.<br>
<br><br><br><div class="gmail_quote">On Fri, Jun 20, 2008 at 12:04 PM, Adam Kelly <<a href="mailto:cthulahoops@gmail.com">cthulahoops@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">2008/6/19 Rapsey <<a href="mailto:rapsey@gmail.com">rapsey@gmail.com</a>>:<br>
</div><div class="Ih2E3d">> The transmit could of course be written with a passive receive, but the code<br>
> would be significantly uglier. I'm sure someone here knows if setting<br>
> {active, once} every packet is CPU intensive or not.<br>
<br>
</div>Is the streaming process building up a message queue (a back log of<br>
messages waiting<br>
to be sent?).  gen_tcp:send does a selective receive in order to<br>
acknowledge that the<br>
packet has been sent, so if the process has a message queue it has to<br>
do a linear search<br>
of the message queue on each send and the streaming becomes O(N^2).<br>
<font color="#888888"><br>
Adam.<br>
</font></blockquote></div><br>