示例#1
0
 private synchronized void addWsClient() {
   if (stat != Stat.INC) {
     return;
   }
   int size = clients.size();
   if ((size % 100) == 0 || size == count) {
     publish(size, failCount, false);
   }
   if (size >= count) {
     if (timerId == TimerManager.INVALID_ID) {
       stop();
     } else {
       stat = Stat.KEEP;
     }
     return;
   }
   WsClientHandler wsClientHandler =
       WsClientHandler.create(false, config.getSelfDomain(), config.getInt(Config.SELF_PORT));
   wsClientHandler.ref();
   wsClientHandler.startRequest(
       this, wsClientHandler, 10000, "/connect", "connect", config.getAdminUrl());
   clients.add(wsClientHandler);
 }