예제 #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;
            }));
        }