Trustin Lee <[EMAIL PROTECTED]> writes:

> Users are supposed to put a message header (or prefix) detection (or
> recognition) code in decodable(), and to put the code that reads the
> actual data fields (or message body) in decode().

I recall being confused by the example (it may not have been this same
example) because there was some duplication of parsing steps in
decodable() and decode(). I wondered, why do all this parsing work in
decodable() only to repeat it later in decode()?

With that question in mind, if decodable() returns
MessageDecoderResult.OK, is it safe for the decoder to cache any
parsed "header data" for a subsequent call to decode()? That is, can
the decoder assume that the next call it will receive for a given
session after decodable() is decode() for the same message?

-- 
Steven E. Harris

Reply via email to