Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-09-2009, 02:38 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 13
axiixc is on a distinguished road
Question Good network reachability testing

I'm having a really hard time getting good network connecting checking in an application. It is an audio stream player, so I need to be alerted pretty quickly about changes in network connection, and I've already tried the apple reachability sample code, but it doesn't seem to always work (specifically I don't think I've enabled the notifications right).

It works ok when starting up if the WiFi is turned off (error appears quickly and all), but if the connection drops it will hang and crash (it appears to never get the notification). I've tried implimenting reachability checks at every major point of the app and it still doesn't seem to work. I should note that it fails the worst when I just unplug the internet from the router and not the router itself. It takes a full minute sometimes to realize the server stopped responding (at least until I get notified of it).

All in all my current model sucks and I'd really appreciate help in how to work in good network checking. The only real requirement is it be able to alert me when the network drops so I can take action to shut down the stream and stream info updater. Realizing the connection is back and restarting the stream is a plus but I'll settle for anything that works at this point. Thanks!
axiixc is offline   Reply With Quote
Old 06-10-2009, 06:13 AM   #2 (permalink)
Registered Member
 
macoholic's Avatar
 
Join Date: Dec 2008
Location: around a Mac...in Pune,India :)
Posts: 137
macoholic is on a distinguished road
Default

Why not check for Connectivity over a timer....It may be a overhead....but as soon as you loose network you will gt notified abt it
macoholic is offline   Reply With Quote
Old 06-10-2009, 10:34 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 13
axiixc is on a distinguished road
Default

Ok, so I think I've figured out my original problem. The reachability only tests for network connection, not actual internet connection. So when the internet went offline, the network was still there.
axiixc is offline   Reply With Quote
Old 06-10-2009, 10:42 AM   #4 (permalink)
Registered Member
 
Join Date: Mar 2009
Location: Toronto, ON
Posts: 111
CanadaDev is on a distinguished road
Default

There's an example in the SeismicXML code from Apple on how to perform a test on launch. You can just choose to not cache the result but run it once in a while.
CanadaDev is offline   Reply With Quote
Reply

Bookmarks

Tags
network

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 336
7 members and 329 guests
givensur, ipodphone, jbro, mer10, mtl_tech_guy, Punkjumper, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,881
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:12 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0