simplified bonjour

Discussion in 'iOS Programming' started by chhoda, Apr 8, 2010.

  1. chhoda macrumors 6502

    Joined:
    Oct 25, 2008
    #1
    I found bonjour a little confusingdespite reading few times, does gamekit replace/simplify bonjour ?
    the example code that apple gives is bonjour example, is there a simplified approach in 3.0 onwards ?

    --CH
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    GameKit is built in top of bonjour so yes, it does simplify it somewhat.
     
  3. chhoda thread starter macrumors 6502

    Joined:
    Oct 25, 2008
    #3
    Then, can I host a bonjour service in mac / windows [where my data is already available] and transfer those data to my iPhone or iPod touch ?

    this question is because bluetooth was outa question in our yesterday's discussion.

    Can you give me an example, where Game kit will not be sufficient, and I will have to write those long bonjour code ?

    --CH
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    GameKit will not discover or talk to a Mac or Windows PC. It will only talk to other iPhone OS devices advertising the same GameKit service.

    You could, as I suggested yesterday, spend a lot of time reverse engineering what GameKit is doing (discover the services it advertises etc) and then re-impelment this on Mac/Windows. It'd probably be quicker to just use Bonjour normally though. As I said if you want to do this you're on your own.
     
  5. chhoda thread starter macrumors 6502

    Joined:
    Oct 25, 2008
    #5
    Thanks a lot, but I wonder why fundamentally it wont work !

    couple months back I was able to use bonjour to transfer data from iPhone simulator in mac to another iPhone simulator in another mac connected to same network.

    That way why wont iPhone device be able to connect to an application registering to bonjour in the laptop ?

    --CH
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    Pure bonjour will work fine. If you use GameKit then you loose control over what it will and won't connect to and the underlying message structure used. So it will only talk to other GameKit clients. As GameKit is only available on the iPhone OS that limits what you can talk to.

    As Apple limit access to the Bluetooth stack on iPhone OS your choices basically become WiFi (with or without Bonjour for service discovery) or GameKit.
     
  7. peterja macrumors regular

    peterja

    Joined:
    Jan 21, 2008

Share This Page