/// <summary>
        /// Add endpoint for reverse connection.
        /// </summary>
        /// <param name="endpointUrl">The endpoint Url of the reverse connect client endpoint.</param>
        /// <param name="configEntry">Tf this is an entry in the application configuration.</param>
        private void AddEndpointInternal(Uri endpointUrl, bool configEntry)
        {
            var reverseConnectHost = new ReverseConnectHost();
            var info = new ReverseConnectInfo(reverseConnectHost, configEntry);

            try
            {
                m_endpointUrls[endpointUrl] = info;
                reverseConnectHost.CreateListener(
                    endpointUrl,
                    new ConnectionWaitingHandlerAsync(OnConnectionWaiting),
                    new EventHandler <ConnectionStatusEventArgs>(OnConnectionStatusChanged));
            }
            catch (ArgumentException ae)
            {
                Utils.Trace(ae, $"No listener was found for endpoint {endpointUrl}.");
                info.State = ReverseConnectHostState.Errored;
            }
        }
 public ReverseConnectInfo(ReverseConnectHost reverseConnectHost, bool configEntry)
 {
     ReverseConnectHost = reverseConnectHost;
     State       = ReverseConnectHostState.New;
     ConfigEntry = configEntry;
 }