After reading the ProtocolCodecFilter source code, now I understand. Thanks.

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
>
>
>
>
>

Reply via email to