Пример #1
0
		public override async Task<IPAddress> GetExternalIPAsync()
	    {
            var message = new GetExternalIPAddressRequestMessage();
            var responseData = await _soapClient
                .InvokeAsync("GetExternalIPAddress", message.ToXml())
                .TimeoutAfter(TimeSpan.FromSeconds(4));

            var response = new GetExternalIPAddressResponseMessage(responseData, DeviceInfo.ServiceType);
            return response.ExternalIPAddress;
        }
Пример #2
0
        public override async Task <IPAddress> GetExternalIPAsync()
        {
            var message      = new GetExternalIPAddressRequestMessage();
            var responseData = await _soapClient
                               .InvokeAsync("GetExternalIPAddress", message.ToXml())
                               .TimeoutAfter(TimeSpan.FromSeconds(4));

            var response = new GetExternalIPAddressResponseMessage(responseData, DeviceInfo.ServiceType);

            return(response.ExternalIPAddress);
        }
Пример #3
0
 public override Task<IPAddress> GetExternalIPAsync()
 {
     NatDiscoverer.TraceSource.LogInfo("GetExternalIPAsync - Getting external IP address");
     var message = new GetExternalIPAddressRequestMessage();
     return _soapClient
         .InvokeAsync("GetExternalIPAddress", message.ToXml())
         .TimeoutAfter(TimeSpan.FromSeconds(4))
         .ContinueWith(task =>
         {
             var responseData = task.Result;
             var response = new GetExternalIPAddressResponseMessage(responseData, DeviceInfo.ServiceType);
             return response.ExternalIPAddress;
         });
 }
Пример #4
0
        public override Task <IPAddress> GetExternalIPAsync()
        {
            NatDiscoverer.TraceSource.LogInfo("GetExternalIPAsync - Getting external IP address");
            var message = new GetExternalIPAddressRequestMessage();

            return(_soapClient
                   .InvokeAsync("GetExternalIPAddress", message.ToXml())
                   .TimeoutAfter(TimeSpan.FromSeconds(4))
                   .ContinueWith(task =>
            {
                var responseData = task.Result;
                var response = new GetExternalIPAddressResponseMessage(responseData, DeviceInfo.ServiceType);
                return response.ExternalIPAddress;
            }));
        }