public void start() throws IOException {
checkConfig();
acceptor = createAcceptor();
configure(acceptor);
SessionFactory handler = sessionFactory;
if (handler == null) {
handler = createSessionFactory();
}
handler.setServer(this);
acceptor.setHandler(handler);
acceptor.bind(host != null ? new InetSocketAddress(host, port) : new InetSocketAddress(port));
if (port == 0) {
port = ((InetSocketAddress) acceptor.getLocalAddress()).getPort();