public void start() throws Exception {
    synchronized (_lock) {
      if (this.serverSocket == null) {
        throw new Exception("Server must initialize before start.");
      }
      initWorkers();
      logger.info(name + " started : " + this);
      SocketChannel csocket = null;
      try {
        while (true) {
          if (serverSocket == null) {
            logger.warn("ServerSocket is not open.");
            break;
          }
          selector.select(1000L);// block
          csocket = serverSocket.accept();
          if (csocket == null)
            continue;
          csocket.configureBlocking(false);
          Session session = sessionManager.getSession();
          if (session == null) {
            logger.error("Too many connection.");
            csocket.close();
            continue;
          } else {
            session.setSocketChannel(csocket);
            handleNewSession(session);
          }
        }
      } catch (Exception e) {
        if (csocket != null && csocket.isConnected()) {
          csocket.close();
        }
        logger.error(name + " running exception:", e);
      }
    }
  }