private void ConnectionClose(AgentConnection agent)
        {
            logger.Info($"The connection is no longer available");
            OnAgentHealthcheckStatsUpdated(agent, new AgentHealthState(), string.Empty);

            agent.Disconnect();

            agent.Dispatchers.Clear();
            agent.Processors.Clear();

            foreach (DispatcherBase dispatcher in agent.Dispatchers.Values)
            {
                dispatcher.Stop();
            }

            logger.Info($"Connection closed for agent {agent.Address}");
        }
 public void DisconnectAgent(AgentConnection agent)
 {
     agent.Disconnect();
 }