Example #1
0
        /// <summary>
        /// Creates a new connection with a client.
        /// </summary>
        public void CreateConnection(Uri url, int timeout)
        {
            ITransportListener listener = null;

            if (TransportListeners != null)
            {
                foreach (var ii in TransportListeners)
                {
                    if (ii.UriScheme == url.Scheme)
                    {
                        listener = ii;
                        break;
                    }
                }
            }

            if (listener == null)
            {
                throw new ArgumentException(nameof(url), "No suitable listener found.");
            }

            Utils.Trace((int)Utils.TraceMasks.Information, "Connecting to Client at {0}.", url);
            listener.CreateReverseConnection(url, timeout);
        }