boB Gage wrote:
I'm running into an issue decoding both packets from a device that embeds commands inside it's responses.

Everything is flagged with start/stop bytes and can be parsed without problems. The problem is, at the point in the code that I'm parsing this, I'm in the guts of a specific packet-type Decoder object. This particular object cannot decode the embedded packet (it's a different type) so I need to push the embedded packet data back into Mina's framework in such a way that it's treated as new incoming data and runs through the standard decodable() sequences to find the right decoder object.

It would be a bit overkilling ...

If I understand correctly, you get a message like :

<start><opaque data><end>

with opaqueObject = <some decodable data, using another decoder>


We have that in ADS, and we handle this differently. Basically, this is a two level decoder, encapsulated in the protocolDecoder we have implemented.

If you consider that the decoder is *not* a part of MINA (it's just called through a callback by MINA), you can do whatever you want once you have read your <opaque data>, including calling another decoder from your decoder.

That would probably be the easier way to deal with such messages.

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


Reply via email to