code: protected synchronized void quit() {
          log.debug("Stopping {}", getName());
          closeServerSocket();
  
          // Close all handlers. Handler threads terminate if run loop exits
          synchronized (handlers) {
              for (ProtocolHandler handler : handlers) {
                  handler.close();
              }
              handlers.clear();
          }
          log.debug("Stopped {}", getName());
      }
docs: Quits server by closing server socket and closing client socket handlers.