Hi!

Did you made sure, you read previous the message completely from the 
ByteBuffer? The part you don't read at the *decode* method is passed to the 
decodable (and decode) method again.
So if a message is 5 bytes and you read up to the 4th byte in you 
decode-process, than the 5th byte is the first one at the next call of 
decodable. You just have to do a byteBuffer.get() oder 
byteBuffer.position(byteBuffer.position+1) at the end of your decode method, to 
consume that byte.

hth & regards

Steve

> Johny Kadarisman [mailto:[EMAIL PROTECTED] wrote:
>
> Emannuel,
>
> I think I found the problem. The decodable() methods doesn't receive a
> clean
> bytebuffer (or with a left over unused byte from previous decoder) even
> after I successfully decode the message.
>
> Which module is actually responsible to call compact() method on the
> bytebuffer?
>
>
> On Fri, May 30, 2008 at 9:47 AM, Emmanuel Lecharny
> <[EMAIL PROTECTED]>
> wrote:
>
> > Johny Kadarisman wrote:
> >
> >> I run for standalone, its correct. Any changes from my previous
> code?
> >>
> >>
> >
> > I replaced the debug calls by System.out, removed the response object
> > (didn't had the code for it), used a HashMap to store parameters, and
> that's
> > it.
> >
> > One more point : doing str.getBytes() is not good. Depending on your
> local
> > default String encoding, you may have a totally different result from
> one
> > machine to another one. You should do getBytes( encoding ) where
> encoding is
> > the encoding used for your string. In your case, "UTF-8" should be
> ok.
> >
> >
> >
> > --
> > --
> > cordialement, regards,
> > Emmanuel Lécharny
> > www.iktek.com
> > directory.apache.org
> >
> >
> >

Reply via email to