If I were to code the following code segment:
class SimpleHandler extends SimpleChannelUpstreamHandler {
...
public static void main( String[] args ) throws Exception {
ServerBootstrap b = new ServerBootstrap(
new NioServerSocketChannelFactory(
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool(),
10 ));
b.setPipelineFactory( new ChannelPipelineFactory() {
public ChannelPipeline getPipeline() throws Exception {
return Channels.pipeline( new SimpleHandler() );
}
});
b.bind( new InetSocketAddress( p ));
}
And assuming the following scenario:
- channel C1 has input
- netty assigns thread T1 to channel C1
- after thread T1 has read all the input from channel C1, and while it is still processing the input, more input arrives at channel C1
My question is: will netty assign a new thread to channel C1 (assuming there are free threads in the thread pool)?
Thanks in advance