コード例 #1
0
  private void stepTimeout() {
    boolean updated = false;
    synchronized (channels) {
      Iterator<ChannelInfo> it = channels.values().iterator();
      while (it.hasNext()) {
        ChannelInfo channel = it.next();
        Iterator<UserInfo> removed = channel.stepTimeout(getTimeoutLimit());

        if (removed != null) {
          updated = true;
          String channelName = channel.getChannelName();
          while (removed.hasNext()) {
            UserInfo user = removed.next();
            ServerLogger.getInstance()
                .channelLeaved(channelName, user.getUserName(), user.getInetSocketAddress());
          }
          if (channel.isEmpty()) {
            it.remove();
            ServerLogger.getInstance().channelRemoved(channelName);
          }
        }
      }

      if (updated) {
        updateChannelsCache();
      }
    }
  }
コード例 #2
0
 public String printUser() {
   return m_User == null ? "" : m_User.getName();
 }