DelimiterBasedFrameDecoder delimiter

Olivier ROLAND olivier.roland at laposte.net
Fri Jun 24 09:45:42 EDT 2011


You don't have to write a custom decoder, your custom delimiter is OK and will generate one and only one frame from "hello world\n\r"

What you describe corresponds to something like this
pipeline.addLast("framer", new DelimiterBasedFrameDecoder(
                8192,new ChannelBuffer[] {
    ChannelBuffers.wrappedBuffer(new byte[] { '\n' }),
    ChannelBuffers.wrappedBuffer(new byte[] { '\r' }),
}));

Double check your input stream.

Le 24 juin 2011 à 11:08, Zlatko Josic a écrit :

> Yes I am shure, The delimiter is "\n\r" . We have system based on Mina framework and now we want to extend it to work with Netty framework too.
> I have tried with pipeline.addLast("frameDecoder", new DelimiterBasedFrameDecoder(2048, ChannelBuffers.wrappedBuffer(new byte[] { '\n', '\r' })));
> but it works as it has two delimiters '\n' and '\r'. 
> 
> So it seams the only solution is writting custom decoder.
> 
> Zlaja
> 
> 
> On Fri, Jun 24, 2011 at 9:45 AM, Olivier ROLAND <olivier.roland at laposte.net> wrote:
> 
> >
> > Hi,
> >
> > Is it possible to have String delimiter in DelimiterBasedFrameDecoder? For
> > example I want to have "\n\r" as delimiter. So if I have string line "hello
> > world\n\r" I want to get one frame from DelimiterBasedFrameDecoder instead
> > of two.
> >
> > Thanks
> >
> > Zlaja
> >
> > --
> > View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/DelimiterBasedFrameDecoder-delimiter-tp6510246p6510246.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
> >
> 
> You can of course implement a custom delimiter if you really want \n\r in that order but are you sure ;-)
> Use org.jboss.netty.buffer.ChannelBuffer.Delimiters as an example.
> If you want  to deal with standard \r\n see org.jboss.netty.example.telnet.TelnetServerPipelineFactory as an example.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
> 
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20110624/514d58d1/attachment.html 


More information about the netty-users mailing list