On 4/5/07, Coding Horse <[EMAIL PROTECTED]> wrote:
My next question is how to clean up after(or before?) NOT_OK is returned from
decodable() when protocol being violated. I want to close the session.
Should I clean up the buffer by myself? Why I asked this question is
because I got "ProtocolDecoderException: No appropriate message decoder".
What is the correct way to handle this since I don't want to decode it(I
know that protocol was violated already)?
DemuxingProtocolCodecFactory automatically throws a
ProtocolDecoderException ("no appropriate message decoder") when
there's no candidate left. So you will be notified via
exceptionCaught handler method. You can close the session there.
If you allocated some resource that needs explicit deallocation, then
you have to take care of it within decodable(), but I don't think most
decodable() implementations won't need such complex logic. If there's
one, please let me know.
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6