SimpleChannelHander query

manish_iitg excellencetechnologies08 at gmail.com
Wed Dec 31 11:17:37 EST 2008


In the below code, from the netty examples. 
In line 43 it calls a funciton pipeline(); 
what function is this and in which class is this defined.


public class FactorialServerPipelineFactory implements
40          ChannelPipelineFactory {
41  
42      public ChannelPipeline getPipeline() throws Exception {
43          ChannelPipeline pipeline = pipeline();
44  
45          // Add the number codec first,
46          pipeline.addLast("decoder", new BigIntegerDecoder());
47          pipeline.addLast("encoder", new NumberEncoder());
48  
49          // and then business logic.
50          // Please note we create a handler for every new channel
51          // because it has stateful properties.
52          pipeline.addLast("handler", new FactorialServerHandler());
53  
54          return pipeline;
55      }
56  }





Trustin Lee-3 wrote:
> 
> I'm not sure I understood your question correctly, but here's my answer.
> :-)
> 
> Even if you have specified ChannelPipelineCoverage as "one", it doesn't
> necessarily mean that a new ChannelHandler instance will be created for
> each
> Channel automatically.  You need to create it by yourself in your
> ChannelPipelineFactory.  Please refer to the Factorial example:
> 
>    - http://tinyurl.com/6wgwtd
> 
> HTH,
> Trustin*
> *
> On Tue, Dec 30, 2008 at 8:26 PM, manish_iitg <
> excellencetechnologies08 at gmail.com> wrote:
> 
>> I have ChannelPipelineCoverage as "one" in my for my server handler. Even
>> then after i close my connection from the client by called
>> e.getChannl().close() and then after some time again start a connection
>> by
>> bind to the server, a new instance of server handler is not create.
>> Please
>> tell my what i am doing wrong. What i want is that, when a client
>> connects
>> to the server a new server handler should be created.
> 
> 
> -- 
> Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
> --
> what we call human nature in actuality is human habit
> --
> http://gleamynode.net/
> 
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
> 
> 

-- 
View this message in context: http://n2.nabble.com/SimpleChannelHander-query-tp2092051p2096456.html
Sent from the Netty User Group mailing list archive at Nabble.com.




More information about the netty-users mailing list