Thanks!

Not using anything low level... hence the surprise.... we actually use it to determine if our login url is reachable; if not we work "offline". I'll take a deeper look at what we are doing there.

Gary


On Oct 18, 2012, at 1:12 PM, David Duncan wrote:

On Oct 18, 2012, at 12:55 PM, M Pulis <tooth...@fastq.com> wrote:

My iOS app uses the Reachability sample code to detect network availability to work "offline" or "online".

When using 3G, we get to the "connectionrequired" state. What to do then? We try a login to our web site and that fails.

WIFI works great, but we need 3G also.

What am I missing or should read up on?


If you use CF or NS (or anything build on top of that) to connect, then it should "just work". If you are using raw BSD sockets, then there is no way to connect other than using CF or NS.

Also Reachability isn't meant to be used to determine online vs offline. Its meant to determine if it is a good time to try to connect or not. Due to realities of networking it is entirely possible for Reachability to tell you "try to connect" and to fail completely.

Basically when using Reachability, you should always use the callback to know when to retry any previously failed connections, and once you get a callback that says that connection is possible, then you should try to make the connection, while continuing plan for possible failure.
--
David Duncan

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to