LengthFieldBasedFrameDecoder variable length field problem.
magneticB
tom.townsend at gmail.com
Tue Aug 2 13:40:06 EDT 2011
Hi,
I'm decoding a simple text based protocol with Netty. I issue text commands
and an HTTP-like response including xml message comes back from the server,
for example:
200 2769 OK Command completed successfully
<?xml version="1.0" encoding="utf-8" ?>...
On the first line 200 is the response code, it uses HTTP status codes, but
doesn't conform to HTTP standard. After that 2769 indicates the length of
the message. Clearly if the message is short this number will have a sorter
length. How can I use LengthFieldBasedFrameDecoder to cater for a length
field that itself changes in length? No padding around this field is used.
Here's an example of a shorter response:
200 10 OK Command completed successfully
<?xml vers
Is LengthFieldBasedFrameDecoder the best approch for splitting a text based
protocol? Unfortunately no delimiter is appended to the end of the message
or I would use DelimiterBasedFrameDecoder.
Thanks for any help,
Tom
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/LengthFieldBasedFrameDecoder-variable-length-field-problem-tp6645775p6645775.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list