code: public void start(final int timeout, boolean daemon) throws IOException {
          this.myServerSocket = this.getServerSocketFactory().create();
          this.myServerSocket.setReuseAddress(true);
  
          ServerRunnable serverRunnable = createServerRunnable(timeout);
          this.myThread = new Thread(serverRunnable);
          this.myThread.setDaemon(daemon);
          this.myThread.setName("NanoHttpd Main Listener");
          this.myThread.start();
          while (!serverRunnable.hasBinded && serverRunnable.bindException == null) {
              try {
                  Thread.sleep(10L);
              } catch (Throwable e) {
                  // on android this may not be allowed, that's why we
                  // catch throwable the wait should be very short because we are
                  // just waiting for the bind of the socket
              }
          }
          if (serverRunnable.bindException != null) {
              throw serverRunnable.bindException;
          }
      }
docs: Start the server.
  
  @param timeout
  timeout to use for socket connections.
  @param daemon
  start the thread daemon or not.
  @throws IOException
  if the socket is in use.