IPhone: choice between internet connection and wifi

Discussion in 'iOS Programming' started by arnieterm, Dec 25, 2009.

  1. arnieterm macrumors regular

    Joined:
    Aug 28, 2008
    #1
    How can we check that whatever network request we send goes through internet connection available over carreir or through wi-fi. I would like to know about the priority order of sending request by Iphone OS when both kind of network are available. My problem is not to detect which network is available because that can be done via the code snippet in "Reachability" sample
    Thanks
    Arnieterm
     
  2. miep macrumors newbie

    Joined:
    Jul 6, 2007
    #2
    Sounds like you want to force some data over carrier, or over wifi, no?

    I'm not sure why you would want to muck around with that - it seems like a good idea to have the iPhone/user decide that. You don't know the networking environment the user is in. If it is a bandwidth issue, test for available bandwidth, rather than available channel.
     
  3. KoolStar macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky
  4. arnieterm thread starter macrumors regular

    Joined:
    Aug 28, 2008
    #4
    I think I am not fully explained my point. My problem is that I have to detect a device with wifi in my iphone's local wifi network and if the detection is successful then send some json request to that device. If the search is not successful then send http request to a remote web service.
    Thanks
    Arnieterm
     
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    A particular device or any device or what?
     
  6. arnieterm thread starter macrumors regular

    Joined:
    Aug 28, 2008
    #6
    A particular device. It is a sercomm router with embedded linux. The device has an application running on it. That app communicates with tcp/ip using json request/response.
    Currently my iphone has only wifi configured with no carrier [internet connection]. Whatever network request [http/tcp|ip] goes through wifi to a switch and that switch is connected to a local network that forwards the request based on its type. So this development setup does not actually represent the production setup where both iphone and linux device are on wifi. Also using NSStream classes I am successfully able to send and receive request to that linux device. The only thing that is bothering me is what problems/issues my iphone application will face when run under production setup.
    In my iphone application, I have to first search that device in local wifi. If available then the communication with that device begins otherwise the iphone application will send request to a remote web service
     

Share This Page