checkConfig();
acceptor = new NioSocketAcceptor();
((NioSocketAcceptor) acceptor).setReuseAddress(reuseAddress);
SessionFactory handler = sessionFactory;
if (handler == null) {
handler = new SessionFactory();
}
handler.setServer(this);
acceptor.setHandler(handler);
acceptor.bind(new InetSocketAddress(port));
if (port == 0) {
port = ((InetSocketAddress) acceptor.getLocalAddress()).getPort();