Re: CFNetwork, round-robin DNS and IP failover
Re: CFNetwork, round-robin DNS and IP failover
- Subject: Re: CFNetwork, round-robin DNS and IP failover
- From: Josh Graessley <email@hidden>
- Date: Wed, 06 Apr 2011 22:12:49 -0700
On Apr 6, 2011, at 9:19 PM, Van Tol, Ladd wrote:
> Suppose I am implementing an iPhone app that accesses an HTTP web service. The service is available at multiple physical locations, and is already setup with round-robin DNS. As such, if I fail a network connection, I would like to be able to cycle to the next host in the list, on the off chance that one of the facilities is having network issues.
>
> I am currently using CFNetwork and CFHTTP*. What would be the easiest way to implement this? Do the DNS lookup myself with CFHost, and synthesize the URLs to have the desired IP address instead of host name?
I suspect that if you do this, the Host field the the HTTP GET will be the IP address instead of the name that resolves to that IP address. For example, if spi.foo.com. was also hosted on those same ip addresses, passing the address as a string to CFHTTP would lead to an HTTP get request that wouldn't provide enough information to the server to differentiate between api.foo.com and spi.foo.com.
-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