Sorry, Andrew, sometimes I take offense when I feel like someone is implying I haven't done my due diligence. But I'm always happy to have my assumptions challenged. :)
I'm also not at all challenging your interpretation of how reachability works. In this case, I'm quite sure the radios are already active, but the reachability check will fail either way, because of the DNS check you mentioned - I had already tested that a DNS lookup for our host does in fact fail. Nonetheless, a request through the proxy will succeed, because the client doesn't actually contact our server, but hits the proxy instead. It's a good point that actually making a request will activate the radios even if they would not otherwise be active, and that's the kind of feedback I was looking for. Sounds like the right thing to do is probably to do a check for reachability on the zero address (as Apple does in their sample code for reachabilityForInternetConnection), which should tell us if the radio is active, and then if the radio is active, we can then make a request to verify that the server is actually reachable. That way, we won't unnecessarily tax the battery. Any other problems you can think of with this approach? Jens, is this a fix you'd consider pulling in if I submitted a pull request? - Ian On May 16, 2014, at 12:36 PM, Andrew W. Donoho <[email protected]> wrote: > Ian, > > You've obviously taken offense. I cast no aspersions on your character > but did attempt to change what appears to be a misunderstanding of how > reachability functions. Please don't attribute malice to pedantry. > > The evidence you present is fully consistent with my interpretation of > how reachability works. It will never bring up the radios when you call it. > It really only checks their status after they are on and reports when they > are turned off or change state. > > Now, CBL may not choose to bring up the radios in response to a > reachability. That is their choice. And the fix is pretty trivial. Just touch > the server with NSURLConnection. > -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/D0153EEA-1C4A-4C6C-ABEF-2FE874DB4AE1%40gmail.com. For more options, visit https://groups.google.com/d/optout.
