private TcpIpConnectionMonitor getConnectionMonitor(Address endpoint, boolean reset) {
   TcpIpConnectionMonitor monitor =
       ConcurrencyUtil.getOrPutIfAbsent(monitors, endpoint, monitorConstructor);
   if (reset) {
     monitor.reset();
   }
   return monitor;
 }
Esempio n. 2
0
  public void close(Throwable t) {
    if (!live) {
      return;
    }
    try {
      close0();
    } catch (Exception e) {
      logger.warning(e);
    }

    Object connAddress = getConnectionAddress();
    String message = "Connection [" + connAddress + "] lost. Reason: ";
    if (t != null) {
      message += t.getClass().getName() + "[" + t.getMessage() + "]";
    } else {
      message += "Socket explicitly closed";
    }

    logger.info(message);
    connectionManager.destroyConnection(this);
    connectionManager.ioService.onDisconnect(endPoint);
    if (t != null && monitor != null) {
      monitor.onError(t);
    }
  }