private void handleEventSession() {
    Iterator<Session> eventSessions = eventSessionList.iterator();
    while (eventSessions.hasNext()) {
      Session session = eventSessions.next();
      if (session != null) {
        try {
          if (session.getCurrentEvent() == Session.Event.TIMEOUT) {
            timeoutEvent(session);
          } else if (session.getCurrentState() == Session.IoState.READ) {
            readEvent(session);
          } else if (session.getCurrentState() == Session.IoState.WRITE) {
            writeEvent(session);
          }
        } catch (Exception e) {
          logger.error("", e);
          eventSessions.remove();
          close(session);
        }
      }
    }
  }