public static void main(String[] args) throws Exception {
SocketAcceptor acceptor = new NioSocketAcceptor();
acceptor.setReuseAddress(true);
ProtocolCodecFilter pcf = new ProtocolCodecFilter(
new TextLineEncoder(), new CommandDecoder());
acceptor.getFilterChain().addLast("log1", new LoggingFilter("log1"));
acceptor.getFilterChain().addLast("codec", pcf);
// acceptor.getFilterChain().addLast("authentication", createAuthenticationIoFilter());
acceptor.getFilterChain().addLast("log2", new LoggingFilter("log2"));
acceptor.setHandler(createIoHandler());
acceptor.bind(new InetSocketAddress(PORT));
}