For those who might read this thread later via the ML archive, I will
clarify a little bit more.
On 4/28/07, mat <[EMAIL PROTECTED]> wrote:
After reading the ProtocolCodecFilter source code, now I understand. Thanks.
Yes, ProtocolCodecFilter doesn't pass a ByteBuffer to an encoder.
Calling IoSession.write() with a ByteBuffer will simply bypass the
encoding process.
2007/4/27, mat <[EMAIL PROTECTED]>:
>
> Can you explain in detail? How ProtocolCodecFilter will
> not attempt to encode? I wrote the encoder by myself.
>
> The following message will never be called??
> public void encode(IoSession session, Object message,
> ProtocolEncoderOutput out) throws Exception
> {
> AbstractMessage m = (AbstractMessage)message ;
> ByteBuffer buf = ByteBuffer.allocate(1024);
> buf.setAutoExpand(true); // Enable auto-expand for easier encoding
>
> encodeBody(session, m, buf);
> buf.flip();
> out.write(buf);
> }
>
>
>
> 2007/4/26, peter royal <[EMAIL PROTECTED]>:
> >
> > On Apr 25, 2007, at 9:52 AM, mat wrote:
> > >>> You meant if I use session.write(bytebuffer) in IOHandler, the
> > >>> encodeBody
> > > in protocol filter will never be called?
> > > So you can still use it for decoding safely.
> > >>> You meant encoding?
> >
> >
> > yes.. if you session.write(ByteBuffer), the ProtocolCodecFilter will
> > not attempt to encode.
> >
> > -pete
> >
> >
> > --
> > [EMAIL PROTECTED] - http://fotap.org/~osi
> >
> >
> >
> >
> >
>
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6