How to reliable and efficiently implement a string protocol
Sébastien Pierre
sebastien.pierre at gmail.com
Thu Nov 4 13:02:11 EDT 2010
Thanks a lot, Lee !
-- Sébastien
2010/11/3 ljohnston <johnstlr at yahoo.co.uk>
>
> Assuming your messages only go from client to server then your client needs
> a
> StringEncoder and the server needs to combine DelimiterBasedFrameDecoder
> and
> StringDecoder. For example
>
> client
>
> ...addLast("encoder", new StringEncoder(CharsetUtil.UTF_8));
>
> server
>
> ...addLast("delimiter", new DelimiterBasedFrameDecoder(65535,
> Delimiters.lineDelimiter());
> ...addLast("decoder", new StringDecoder(CharsetUtil.UTF_8));
>
> By default the DelimiterBasedFrameDecoder will strip the line delimiters
> from the message. There are alternative constructors which allow you
> specify
> whether the delimiters should be stripped or not.
>
> Cheers
> Lee
> --
> View this message in context:
> http://netty-forums-and-mailing-lists.685743.n2.nabble.com/How-to-reliable-and-efficiently-implement-a-string-protocol-tp5697794p5702731.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20101104/df4d9ae1/attachment.html
More information about the netty-users
mailing list