as aj wrote:
Hi everyone,
Hi,

Fot what it worths, I have had the same problem when writing the Ldap decoder : it's a two layer protocol.

The received message is a PDU, structured as TLV (Type, Length, Value), and the Type and Length element have to be decoded as they may be multi-bytes (this is the case for length).

What I did, instead of using two decoders, was to define a stateful decoder : I associated a container to the session (ie, a java class instance containing the partial results) and when I received a few mor ebytes, I just restarted the decoding from the point I stopped.

That mean you have to keep a few elements in memory so that you can restart wherever you stopped during the decoding.

It's not that complex to write.

Now, I agree that it would be much easier to use two decoders in the filter chain.

It's a bit old for me to remember exactly how it works, and I'm afraid I will not have a lot of time in the next 3 weeks to go deep into the code... Anyone else ?

--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to