예제 #1
0
        async protected virtual Task <IPEndPoint> GetIPEndpoint()
        {
            var uri  = new Uri(Prologue.Destination, UriKind.Absolute);
            var host = uri.Host;
            var port = uri.Port;

            var ipEndPoint = await IPEndPointProvider.Get(host, port);

            return(ipEndPoint);
        }
예제 #2
0
        protected override async Task <IPEndPoint> GetIPEndpoint()
        {
            var host             = GetHostName(); //Prologue.Destination;
            var port             = 443;
            var destinationParts = Prologue.Destination.Split(new[] { ':' }, StringSplitOptions.RemoveEmptyEntries);

            if (destinationParts.Length > 1)
            {
                host = destinationParts[0];
                port = Convert.ToInt16(destinationParts[1]);
            }

            //Debug.WriteLine("Resolve DNS");
            var ipEndpoint = await IPEndPointProvider.Get(host, port);

            return(ipEndpoint);
        }