So how do you do this at the TCP layer and not use threads within Netty... <br><br>You should be able to tell netty to not read from the socket even if it is available because you&#39;re not yet ready for the data.<br><br>

This way all TCP protocols will work the same way without application specific changes or controlling the client.<br><br>Otherwise you have to use lots of threads which defeats the whole point :-( <br><br>Kevin<br><br><div class="gmail_quote">

On Tue, Oct 25, 2011 at 4:23 PM, &quot;이희승 (Trustin Lee)&quot; <span dir="ltr">&lt;<a href="mailto:trustin@gmail.com">trustin@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div>Yes.  If you have more control over the behavior of the client, I would make use of 100-continue, and send an error response when the server is under load.<br>
<br>
HTH<div class="im"><br>
<br>
Kevin Burton wrote:<br>
&gt; I assume I basically have to change interest ops on the channel when <br>
&gt; the buffer is empty/full?<br>
&gt;<br>
&gt; Kevin<br>
&gt;<br>
&gt; On Tue, Oct 25, 2011 at 4:18 PM, Kevin Burton &lt;<a href="mailto:burtonator@gmail.com" target="_blank">burtonator@gmail.com</a> <br></div><div class="im">
&gt; &lt;mailto:<a href="mailto:burtonator@gmail.com" target="_blank">burtonator@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     How do I tell the sender of data (I control both) to back off if I<br>
&gt;     can&#39;t accept any more data on the server?<br>
&gt;<br>
&gt;     Specifically, I have an HTTP PUT implementation that first writes<br>
&gt;     to a queue and then I drain the queue to disk.<br>
&gt;<br>
&gt;     When the queue fills up because the server is overloaded, I need a<br>
&gt;     way to tell the sender to back off...<br>
&gt;<br>
&gt;     Normally the TCP buffers would just fill up on both ends and the<br>
&gt;     sender wouldn&#39;t receive ACKs any more and wouldn&#39;t send more<br>
&gt;     packets until the existing ones have been ack&#39;d ...<br>
&gt;<br>
&gt;     I just don&#39;t now how to tell Netty to stop sending me data because<br>
&gt;     I can&#39;t handle it...<br>
&gt;<br>
&gt;     I don&#39;t want to use any threads in my application if they&#39;re not<br>
&gt;     needed.<br>
&gt;<br>
&gt;<br></div>
&gt; _______________________________________________<br>
&gt; netty-users mailing list<br>
&gt; <a href="mailto:netty-users@lists.jboss.org" target="_blank">netty-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a></div><br>_______________________________________________<br>
netty-users mailing list<br>
<a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br></blockquote></div><br>