SocketAcceptorConfig cfg = new SocketAcceptorConfig();
cfg.setReuseAddress( true );
cfg.getFilterChain().addLast(
"protocolFilter",
new ProtocolCodecFilter( new HttpServerProtocolCodecFactory() ) );
cfg.getFilterChain().addLast( "logger", new LoggingFilter() );
acceptor.bind( new InetSocketAddress( port ), new ServerHandler(), cfg );
System.out.println( "Server now listening on port " + port );
}