Jump to content

Requesting SystemInfo from IApplicationHost "GetSystemInfo" method


Recommended Posts

Posted

Hi! quick question about requesting SystemInfo through the IApplicationHost.

I'm looking to get the WANAddress for the server. I'm just wondering about the "remoteAddress" parameter in the "GetSystemInfo" method.

Could I just do a loopback on the IPAddress?

        public async Task<string> GetWanAddressAsync()
        {
            var sysInfo = await Host.GetSystemInfo(IPAddress.Loopback, CancellationToken.None);
            return await Task.FromResult(sysInfo.WanAddress);
        }

 

Something tells me that isn't the data the function is looking for.

Has anyone else done this is C#?

Posted

Huh... never mind, using the loopback seems to work just fine.

  • Thanks 1
rbjtech
Posted (edited)

I'm not sure how you are using the WAN Address, but you may want the WAN DNS FQDN rather than the IP - as the IP is usually dynamic and may change ?  

Just a thought. 

 

Edited by rbjtech
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...