I fixed my problem by replacing the protocolcodecfilter dynamically.

On 6/27/07, mat <[EMAIL PROTECTED]> wrote:

I still wonder if we asked the same questions. Actually for that link, I
don't understand very well. If you dig out something, can you share with
me?
Thanks.

On 6/27/07, slowness chen <[EMAIL PROTECTED]> wrote:
>
> thanks, this link is helpful
>
> On 6/27/07, mat <[EMAIL PROTECTED]> wrote:
> >
> > Do we ask the same questions?
> >
> >
>
http://www.nabble.com/How-can-I-configure-multiple-decoders-in-MINA--tf3561571.html#a9946908
> >
> >
> > On 6/27/07, slowness chen <[EMAIL PROTECTED]> wrote:
> > >
> > > I tried extending from ProtocolCodecFilter :
> > >
> > > public class MyProtocolCodecFilter extends ProtocolCodecFilter{
> > >    public MyProtocolCodecFilter(ProtocolCodecFactory factory) {
> > >        super(factory);
> > >    }
> > >    public void onPreAdd( IoFilterChain parent, String name,
NextFilter
> > > nextFilter ) throws Exception
> > >    {
> > >    }
> > > }
> > >
> > > now the session is set up sucessfully,but only the first
> > > ProtocolCodecFilter
> > > 's "decode" gets called.
> > >
> > > On 6/26/07, Germán Borbolla Flores <[EMAIL PROTECTED]>
> wrote:
> > > >
> > > > Maybe you could extend from ProtocolCodecFilter and override
> onPreAdd,
> > > > and remove the validation, I think that might just work.
> > > >
> > > > Germán Borbolla Flores wrote:
> > > > > You cannot add more than one ProtocolCodecFilter:
> > > > >
> > > > > --- Taken from ProtocolCodecFilter.java
> > > > >        if( parent.contains( ProtocolCodecFilter.class ) )
> > > > >        {
> > > > >            throw new IllegalStateException( "A filter chain
cannot
> > > > > contain more than one ProtocolCodecFilter." );
> > > > >        }
> > > > >
> > > > > Maybe the exception is not getting caught.
> > > > >
> > > > >
> > > > > slowness chen wrote:
> > > > >> Hey guys,
> > > > >>
> > > > >> I  have multiple ProtocolCodecFilters:
> > > > >>
> > > > >>        SocketAcceptorConfig cfg = new SocketAcceptorConfig();
> > > > >>        cfg.getSessionConfig().setReuseAddress( true );
> > > > >>        cfg.getFilterChain().addLast( "codec1", new
> > > ProtocolCodecFilter(
> > > > >> new
> > > > >> MyCodecFactory1( )));
> > > > >>        cfg.getFilterChain().addLast( "codec2", new
> > > ProtocolCodecFilter(
> > > > >> new
> > > > >> MyCodecFactory12( )));
> > > > >>
> > > > >> every filter works fine by itself, but if I use both, the
server
> > > > doesn't
> > > > >> even go to the sessionCreated callback,
> > > > >> and my socket client gets the following error sometimes:
> > > > >>    socket.error: (10053, 'Software caused connection abort')
> > > > >> or sometimes receives nothing and return.
> > > > >>
> > > > >> I am quite new to Mina, so any suggest may be helpful. Thanks.
> > > > >>
> > > > >> Best,
> > > > >> Chen
> > > > >>
> > > >
> > >
> >
>

Reply via email to