Re: waiting for IPv4 addresses over bluetooth
Re: waiting for IPv4 addresses over bluetooth
- Subject: Re: waiting for IPv4 addresses over bluetooth
- From: justin webster <email@hidden>
- Date: Sun, 01 Jun 2014 12:32:59 +1200
thanks, the explanation of the time delay is exactly what I was looking for.
> thought you were doing peer-to-peer Bluetooth. But we don't support peer-to-peer Bluetooth between Mac and iOS, so now I suspect you're using Personal Hotspot. Is that right?
I pair the iPad to Mac and use this like an ad-hoc network between the devices. Bonjour for discovery and sockets/streams for the rest.
> What are you doing with this IP address anyway?
using it to identify a server/interface combination so the user can choose to ignore one of more of these servers on one or more networks.
for example, the user might find the wifi network slow or laggy for our app and prefer the bluetooth - but they still want the wifi connected for the usual reasons.
as far as I can tell my server has no option but to advertise on all network interfaces, so IPv4 address would allow the client to see the difference and choose one over the other.
I was also using the IP to store a record of the users preference towards a particular server/interface.
I tested just now and IPv6 seems to use a common address no matter the network interface used - so I might as well just use the hostName instead.
I think I'm just going to rely on hostName, display the IPv4 address when available and ask the user to carefully consider which network interface they are using.
Certainly not ideal but it's simpler than before.
cheers
justin
On 1/06/2014, at 5:47 AM, "Quinn \"The Eskimo!\"" <email@hidden> wrote:
> On 31 May 2014, at 05:52, justin webster <email@hidden> wrote:
>
>> So is anyone aware if this is a known issue with bluetooth between Mac and iOS?
>
> Hmmm. When I first read you're email I thought you were doing peer-to-peer Bluetooth. But we don't support peer-to-peer Bluetooth between Mac and iOS, so now I suspect you're using Personal Hotspot. Is that right?
>
> Regardless, the reason why you get IPv6 before IPv4 is that IPv6 self-assigned addresses do not require any magic; they always work immediately after the link comes up. In contrast, IPv4 will first make a DHCP request. If that succeeds, it'll use that address, and if that fails it'll use self-assigned. In both cases it takes time for the address to become available.
>
> What are you doing with this IP address anyway? If you're connecting to the server, you should use a connect-from-service (-[NSNetService getInputStream:outputStream:]) or connect-by-name [1] API. These will do the right in all cases.
>
> If you're not connecting to the service, what are you doing with the address. IP addresses, whether v4 or v6, are remarkably un-useful in most cases (-:
>
> Share and Enjoy
> --
> Quinn "The Eskimo!" <http://www.apple.com/developer/>
> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
>
> [1] QA1652 "Using NSStreams For A TCP Connection Without NSHost"
>
> <https://developer.apple.com/library/ios/#qa/qa1652/_index.html>
>
>
> _______________________________________________
> 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
_______________________________________________
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