LengthFieldBasedFrameDecoder variable length field problem.
Marc-André Laverdière
marcandre.laverdiere at gmail.com
Thu Aug 4 03:18:12 EDT 2011
I think that overall you'll need a custom decoder anyway, since you
need to check that you have a 200 and not a 503. So, one first decoder
checks the first 3 characters (not bytes!!! they can be encoded in
UTF-16 or more). If 200, then you are happy.
If not, then you can dismiss the message. If you have the luxury of
closing the connection, then all is well. If more messages are coming
on the same socket, then your design is going to be trickier...
On 8/3/11, magneticB <tom.townsend at gmail.com> wrote:
> I'm reluctant to use 200 as a delimiter as this is a status code and may
> well
> be returned as 503 etc.
>
> Problem I'm having with LengthFieldBasedFrameDecoder is I have to specify
> the length of the length field (lengthFieldLength) in the constructor:
>
> LengthFieldBasedFrameDecoder(int maxFrameLength, int lengthFieldOffset, int
> lengthFieldLength)
>
> You can see see from the example in my previous post that lengthFieldLength
> will change depending how long the response is! Perhaps I need to extend
> LengthFieldBasedFrameDecoder in some way? Thanks for your help,
>
> Tom
>
> --
> View this message in context:
> http://netty-forums-and-mailing-lists.685743.n2.nabble.com/LengthFieldBasedFrameDecoder-variable-length-field-problem-tp6645775p6649328.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
>
--
Marc-André LAVERDIÈRE
"Perseverance must finish its work so that you may be mature and complete,
not lacking anything." -James 1:4
http://asimplediscipleslife.blogspot.com/
mlaverd.theunixplace.com
More information about the netty-users
mailing list