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)?
thanks again! Trustin Lee wrote: > > On 4/5/07, Coding Horse <[EMAIL PROTECTED]> wrote: >> >> Hi, Trustin, >> >> Could you please explain what will happen if NOT_OK is returned in >> decodable()? Is it the recommended way to check protocol header and if a >> violation detected return NOT_OK in decodable()? Thx. > > Then it will be excluded from the candidate MessageDecoder list. > That's all. Decodable() is just a predicate, so we can simply return > NOT_OK if protocol violation is detected. > > You will have to program decodable() as simple as possible so it > doesn't take long time to decide it can be decoded by itself or not. > Any further detailed check should be in decode(). > > Trustin > -- > what we call human nature is actually human habit > -- > http://gleamynode.net/ > -- > PGP Key ID: 0x0255ECA6 > > -- View this message in context: http://www.nabble.com/newbiequestion%3A-protocolcodec-errorhandling-tf3154829.html#a9849090 Sent from the mina dev mailing list archive at Nabble.com.
