<HTML><HEAD><META content="text/html; charset=UTF-8" http-equiv="Content-Type"></HEAD><BODY>Channel.setReadable(false)?<BR>
<BR>
Kevin Burton wrote:<BR>
&gt; So how do you do this at the TCP layer and not use threads within <BR>
&gt; Netty...<BR>
&gt;<BR>
&gt; You should be able to tell netty to not read from the socket even if <BR>
&gt; it is available because you're not yet ready for the data.<BR>
&gt;<BR>
&gt; This way all TCP protocols will work the same way without application <BR>
&gt; specific changes or controlling the client.<BR>
&gt;<BR>
&gt; Otherwise you have to use lots of threads which defeats the whole <BR>
&gt; point :-(<BR>
&gt;<BR>
&gt; Kevin<BR>
&gt;<BR>
&gt; On Tue, Oct 25, 2011 at 4:23 PM, "이희승 (Trustin Lee)" <BR>
&gt; &lt;trustin@gmail.com &lt;mailto:trustin@gmail.com&gt;&gt; wrote:<BR>
&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; Yes.&nbsp; If you have more control over the behavior of the client, I<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; would make use of 100-continue, and send an error response when<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; the server is under load.<BR>
&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; HTH<BR>
&gt;<BR>
&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; Kevin Burton wrote:<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; I assume I basically have to change interest ops on the channel<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; when<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; the buffer is empty/full?<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Kevin<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; On Tue, Oct 25, 2011 at 4:18 PM, Kevin Burton<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;burtonator@gmail.com &lt;mailto:burtonator@gmail.com&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; &lt;mailto:burtonator@gmail.com &lt;mailto:burtonator@gmail.com&gt;&gt;&gt; wrote:<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; How do I tell the sender of data (I control both) to back<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; off if I<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; can't accept any more data on the server?<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; Specifically, I have an HTTP PUT implementation that first<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; writes<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; to a queue and then I drain the queue to disk.<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; When the queue fills up because the server is overloaded, I<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; need a<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; way to tell the sender to back off...<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; Normally the TCP buffers would just fill up on both ends and the<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; sender wouldn't receive ACKs any more and wouldn't send more<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; packets until the existing ones have been ack'd ...<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; I just don't now how to tell Netty to stop sending me data<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; because<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; I can't handle it...<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; I don't want to use any threads in my application if they're not<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; needed.<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; _______________________________________________<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; netty-users mailing list<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; netty-users@lists.jboss.org &lt;mailto:netty-users@lists.jboss.org&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; https://lists.jboss.org/mailman/listinfo/netty-users<BR>
&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; _______________________________________________<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; netty-users mailing list<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; netty-users@lists.jboss.org &lt;mailto:netty-users@lists.jboss.org&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; https://lists.jboss.org/mailman/listinfo/netty-users<BR>
&gt;<BR>
&gt;<BR>
&gt; _______________________________________________<BR>
&gt; netty-users mailing list<BR>
&gt; netty-users@lists.jboss.org<BR>
&gt; https://lists.jboss.org/mailman/listinfo/netty-users</BODY></HTML>