Re: Determining current IPv4 WiFi address of iOS device?
Re: Determining current IPv4 WiFi address of iOS device?
- Subject: Re: Determining current IPv4 WiFi address of iOS device?
- From: Josh Graessley <email@hidden>
- Date: Mon, 14 Oct 2013 10:04:50 -0700
On Oct 9, 2013, at 9:45 AM, Quinn The Eskimo! <email@hidden> wrote:
>
> On 9 Oct 2013, at 16:08, Jens Alfke <email@hidden> wrote:
>
>> I thought of this but was unable to find the API for getting the .local hostname. (Maybe I used to know but have forgotten.) Where is it?
>
> I was under the impression that NSNetService.hostName would give you the name once -netServiceDidPublish: was called. Alas, that doesn't work. It seems you have to create a second service from the name/type/domain of the first (wait until -netServiceDidPublish: is called to get valid results) and then resolve that.
>
> It's annoying that this is so hard. On the Mac you can get this info from System Configuration framework, but not on iOS.
A radar requesting this functionality increases the likelihood that things will improve in time.
I wanted to emphasize Quinns suggestion of using the .local name. One of the big challenges we run in to with networking are issues with devices on different subnets. When you use a .local name, we have the option of connecting using the IPv4 or IPv6 addresses. With IPv6, we almost always have IPv6 link-local addresses. When you resolve a .local name, the resolution will include the IPv6 link-local address and that IPv6 link-local address will include a scope id. The scope id helps the kernel identify which interface that remote address is on and all IPv6 link-local addresses are effective on the same subnet, so you will get fast and efficient communication over the local link.
-josh
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden