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