Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

After the user browses the network in my application and selects the service instance they wish to use, I should save that IP address in my applications preference file, right?

0
Posted

After the user browses the network in my application and selects the service instance they wish to use, I should save that IP address in my applications preference file, right?

0

Wrong. This is a common mistake. With DHCP (and with link-local addressing) it is not safe to assume that the service instance will have the same IP address tomorrow. Addresses can change. Service names are the intended stable identifiers for a service instance. Save the instance name (name, type, and domain) in your application’s preference file, then Resolve it on demand each time the user accesses the service. Note also that you should not store the host name and port number, because you shouldn’t assume that the service instance will necessarily be running on the same port number tomorrow. Instead of storing the host name, store the service instance name (name, type, and domain) and then when you Resolve the service instance name at the time of use you are sure to get the up-to-date IP address and port number.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123