DefaultIoFilterChainBuilder chainBuilder = acceptor.getFilterChain();
final TransportProtocolEncoder encoder = new TransportProtocolEncoder();
final TransportProtocolDecoder decoder = new TransportProtocolDecoder();
encoder.setMaxObjectSize(transportConfig.getMaxSize());
decoder.setMaxObjectSize(transportConfig.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>
KeepAliveFilter kaFilter = new KeepAliveFilter(new PassiveKeepAliveMessageFactory(), IdleStatus.BOTH_IDLE);

DefaultIoFilterChainBuilder chainBuilder = acceptor.getFilterChain();
final TransportProtocolEncoder encoder = new TransportProtocolEncoder();
final TransportProtocolDecoder decoder = new TransportProtocolDecoder();
encoder.setMaxObjectSize(transportConfig.getMaxSize());
decoder.setMaxObjectSize(transportConfig.getMaxSize());
chainBuilder.addLast("codec", new ProtocolCodecFilter(encoder, decoder));
KeepAliveFilter kaFilter = new KeepAliveFilter(new PassiveKeepAliveMessageFactory(), IdleStatus.BOTH_IDLE);
