You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by he...@hotmail.com on 2006/03/16 09:32:38 UTC

How to decode streamly using apache shared-asn1?

Hi,
    I want to decode streamly, that is "A decoder does not have to have the 
whole data sequence to start parsing. If it receives less data then 
required, it will process as much as possible and may be invoked again 
later, when the next chunk of data becomes available. 
". Can anybody give me some suggestions?

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  


Re: How to decode streamly using apache shared-asn1?

Posted by Alex Karasulu <ao...@bellsouth.net>.
helloyattie@hotmail.com wrote:
> Hi,
> I want to decode streamly, that is "A decoder does not have to have
> the whole data sequence to start parsing. If it receives less data
> then required, it will process as much as possible and may be invoked
> again later, when the next chunk of data becomes available. ". Can
> anybody give me some suggestions?
Hmmm this is how the old Snickers LDAP library used to work. It would
process chunks of ASN.1 PDUs as they were handed to it and return a
response via a callback once a complete PDU was demarshalled. I don't
know if MINA at the time actually worked with the LDAP library to
process in chunks although it could.

Trustin once told me that we could enable MINA to do this so I'd expect
an answer from him.

Alex

Re: How to decode streamly using apache shared-asn1?

Posted by Trustin Lee <tr...@gmail.com>.
Hi Helloyattie,

On 3/16/06, helloyattie@hotmail.com <he...@hotmail.com> wrote:
>
> Hi,
>     I want to decode streamly, that is "A decoder does not have to have
> the
> whole data sequence to start parsing. If it receives less data then
> required, it will process as much as possible and may be invoked again
> later, when the next chunk of data becomes available.
> ". Can anybody give me some suggestions?


There is a class called 'CumulativeProtocolDecoder' IIRC.  It buffers
unprocessed part so you can process it later when more data is received.

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6