Bug with DelimiterBasedFrameDecoder + Delimiters.nulDelimiter() or I am doing it wrong?

Mike McGrady mmcgrady at topiatechnology.com
Wed Jul 29 19:09:59 EDT 2009


Could you give the code you replaced and what you replaced it with,  
just to make looking at the situation easier?


On Jul 29, 2009, at 3:20 PM, NicolasDesy wrote:

>
> Hello all,
>
> First of all, I'm quite new to Netty.  I have used to create a small  
> adobe
> policy file server and that's about it.
>
> I'm currently working on an app based on master/slaves model.  I  
> decided to
> use netty for the communication between the master and the slaves.
>
> I have currently the following pipelineFactory on the master :
>
> public ChannelPipeline getPipeline() {
>        ChannelPipeline pipeline = Channels.pipeline();
>        pipeline.addLast("decoder",
>                new DelimiterBasedFrameDecoder(1024,
> Delimiters.nulDelimiter()));
>        pipeline.addLast("handler",
>                new MasterHandler());
>        return pipeline;
>    }
>
>
> On the client side, I send a version request to the server to be  
> sure the
> master and the slave are using the same build.  The request consist  
> of 5
> byte.  An integer which represents the command ID and the a null(0)  
> byte.
>
> I looked a little bit a the source and it seems like the decoder  
> considers
> that every single messages contain a null byte because it invokes the
> unfoldAndFireMessageReceived() every time it received a  
> "messageReceived"
> event.  Which result in my handler receiving the "messageReceived"  
> event
> everytime even if the current message has not been fully received yet.
>
>
> I changed my code to use a custom delimiter instead of
> Delimiters.nulDelimiter() and now it works fine.
>
> Is it a bug or I am doing something wrong?
>
> Thanks in advance,
> Nicolas
> -- 
> View this message in context: http://n2.nabble.com/Bug-with-DelimiterBasedFrameDecoder-%2B-Delimiters.nulDelimiter%28%29-or-I-am-doing-it-wrong--tp3353009p3353009.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users

Mike McGrady
Principal Investigator AF081-028 AFRL SBIR
Senior Engineer
Topia Technology, Inc.
1.253.720.3365
mmcgrady at topiatechnology.com











More information about the netty-users mailing list