DefaultIoFilterChainBuilder chainBuilder = ioConnector.getFilterChain();
final TransportProtocolEncoder encoder = new TransportProtocolEncoder();
final TransportProtocolDecoder decoder = new TransportProtocolDecoder();
encoder.setMaxObjectSize(config.getMaxSize());
decoder.setMaxObjectSize(config.getMaxSize());
<BUG>chainBuilder.addLast("codec", new ProtocolCodecFilter(new ProtocolCodecFactory() {

public ProtocolEncoder getEncoder(IoSession session) throws Exception {
return encoder;
}
public ProtocolDecoder getDecoder(IoSession session) throws Exception {
return decoder;
}
}));</BUG>
ActiveKeepAliveMessageFactory messageFactory = new ActiveKeepAliveMessageFactory(config.getSerializeType());

DefaultIoFilterChainBuilder chainBuilder = ioConnector.getFilterChain();
final TransportProtocolEncoder encoder = new TransportProtocolEncoder();
final TransportProtocolDecoder decoder = new TransportProtocolDecoder();
encoder.setMaxObjectSize(config.getMaxSize());
decoder.setMaxObjectSize(config.getMaxSize());
chainBuilder.addLast("codec", new ProtocolCodecFilter(encoder, decoder));
ActiveKeepAliveMessageFactory messageFactory = new ActiveKeepAliveMessageFactory(config.getSerializeType());
