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'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, "이희승 (Trustin Lee)" <span dir="ltr"><<a href="mailto:trustin@gmail.com">trustin@gmail.com</a>></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>
> I assume I basically have to change interest ops on the channel when <br>
> the buffer is empty/full?<br>
><br>
> Kevin<br>
><br>
> On Tue, Oct 25, 2011 at 4:18 PM, Kevin Burton <<a href="mailto:burtonator@gmail.com" target="_blank">burtonator@gmail.com</a> <br></div><div class="im">
> <mailto:<a href="mailto:burtonator@gmail.com" target="_blank">burtonator@gmail.com</a>>> wrote:<br>
><br>
> How do I tell the sender of data (I control both) to back off if I<br>
> can't accept any more data on the server?<br>
><br>
> Specifically, I have an HTTP PUT implementation that first writes<br>
> to a queue and then I drain the queue to disk.<br>
><br>
> When the queue fills up because the server is overloaded, I need a<br>
> way to tell the sender to back off...<br>
><br>
> Normally the TCP buffers would just fill up on both ends and the<br>
> sender wouldn't receive ACKs any more and wouldn't send more<br>
> packets until the existing ones have been ack'd ...<br>
><br>
> I just don't now how to tell Netty to stop sending me data because<br>
> I can't handle it...<br>
><br>
> I don't want to use any threads in my application if they're not<br>
> needed.<br>
><br>
><br></div>
> _______________________________________________<br>
> netty-users mailing list<br>
> <a href="mailto:netty-users@lists.jboss.org" target="_blank">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></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>