@Override
  public void heartBeatStopped(Connection connection) {
    ClientMessage request = ClientRemoveAllListenersCodec.encodeRequest();
    ClientInvocation removeListenerInvocation = new ClientInvocation(client, request, connection);
    removeListenerInvocation.setBypassHeartbeatCheck(true);
    removeListenerInvocation.invoke();

    final Address remoteEndpoint = connection.getEndPoint();
    final Iterator<ClientListenerInvocation> iterator = eventHandlerMap.values().iterator();
    final TargetDisconnectedException response = new TargetDisconnectedException(remoteEndpoint);

    while (iterator.hasNext()) {
      final ClientInvocation clientInvocation = iterator.next();
      if (clientInvocation.getSendConnection().equals(connection)) {
        iterator.remove();
        clientInvocation.notifyException(response);
      }
    }
  }