// Path: src/main/java/info/jdavid/ok/server/Logger.java
// static final org.slf4j.Logger logger = LoggerFactory.getLogger(HttpServer.class);


import java.io.IOException;
import java.net.BindException;
import java.net.InetAddress;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.Nullable;
import static info.jdavid.ok.server.Logger.logger;
  /**
   * Starts the server.
   */
  public final void start() {
    if (started.getAndSet(true)) {
      throw new IllegalStateException("The server has already been started.");
    }
    try {
      if (!setup.getAndSet(true)) setup();
      final RequestHandler handler = requestHandler();
      if (handler instanceof AbstractRequestHandler) {
        ((AbstractRequestHandler)handler).init();
      }
      final Dispatcher dispatcher = dispatcher();
      dispatcher.start();
      final InetAddress address;
      if (hostname == null) {
        address = null; //new InetSocketAddress(0).getAddress();
      }
      else {
        address = InetAddress.getByName(hostname);
      }

      dispatcher.loop(port, securePort, https, address, hostname,
                      maxRequestSize, keepAliveStrategy, handler);
    }
    catch (final BindException e) {
      throw new RuntimeException(e);
    }
    catch (final IOException e) {
// Path: src/main/java/info/jdavid/ok/server/Logger.java
// static final org.slf4j.Logger logger = LoggerFactory.getLogger(HttpServer.class);


// Path: src/main/java/info/jdavid/ok/server/HttpServer.java
import java.io.IOException;
import java.net.BindException;
import java.net.InetAddress;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.Nullable;
import static info.jdavid.ok.server.Logger.logger;

  /**
   * Starts the server.
   */
  public final void start() {
    if (started.getAndSet(true)) {
      throw new IllegalStateException("The server has already been started.");
    }
    try {
      if (!setup.getAndSet(true)) setup();
      final RequestHandler handler = requestHandler();
      if (handler instanceof AbstractRequestHandler) {
        ((AbstractRequestHandler)handler).init();
      }
      final Dispatcher dispatcher = dispatcher();
      dispatcher.start();
      final InetAddress address;
      if (hostname == null) {
        address = null; //new InetSocketAddress(0).getAddress();
      }
      else {
        address = InetAddress.getByName(hostname);
      }

      dispatcher.loop(port, securePort, https, address, hostname,
                      maxRequestSize, keepAliveStrategy, handler);
    }
    catch (final BindException e) {
      throw new RuntimeException(e);
    }
    catch (final IOException e) {
      logger.error(e.getMessage(), e);