Hi all,

I just want to validate my understanding of Netty here and how server 
connections are accepted.  A typical Netty server has two conceptual 
channels, one channel is effectively a channel of channels, representing a 
stream of incoming connections, and that one creates a new channel pipeline 
to handle each incoming connection.

On the server channel of channels, if you set auto read to false, then this 
will allow you to backpressure on the incoming stream of connections, which 
would allow you to use this to implement a connection limit.  In that case, 
if you did back pressure (ie, by not invoking read() when you receive a 
read complete event), Netty would stop accepting new connections, which 
would cause any subsequent connections received to fill up the OS 
connection backlog, until the SO_BACKLOG limit is reached, at which point, 
the OS will start rejecting connections outright.

Is my understanding here correct?  Before we go and implement it ourselves, 
does Netty provide any built in channel handlers that implement connection 
limit logic?  I imagine it wouldn't be hard to do - you just need a way to 
communicate from the child channel pipelines when a channel has been closed 
so that the connection counter can be decremented and read can be invoked 
again on the channel receiving the connections.

And finally, all this is in the context of Netty 4 - does the same apply to 
Netty 3, using Channel.setReadable() to implement the backpressure?  Play 
of course is on Netty 4, but we have a very large user who are asking about 
this for an older version of Play which is on Netty 3.

Cheers,

James

-- 
You received this message because you are subscribed to the Google Groups 
"Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/netty/43802c13-afb0-40e9-99fc-ff0b52ed3f9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to