Noobie question about Bonjour

Discussion in 'iOS Programming' started by ArchRivalNeo, Jun 8, 2011.

  1. ArchRivalNeo macrumors newbie

    Joined:
    Nov 13, 2010
    #1
    Hey Guys,

    I just recently started programming for the iPhone, and I put my first sample program on my iphone. Basically I ran it on the simulator on one end and the program on my iPhone on the other end. Both are supposed to recognize and be able to send messages between each other.

    When I tested it on my home network, it worked fine as intended...but when I tested it on my university on campus wi-fi, it wouldn't work properly. Neither one running the program would be able to find the other one. I'm guessing it's got to do with how the code handles more wider area networks. I'm not sure what I should be looking for in the code. A little help would definitely be appreciated.

    I found it here

    Oh and btw, is there anyway to make this program work on a more peer-to-peer basis? I mean, can I make it work without the need for them to be connected to a common wi-fi network? (I tried this at home on different networks and it didn't work)
     
  2. Sykte macrumors regular

    Joined:
    Aug 26, 2010
    #2
    You may want to look into game kit. Bonjour is great on a simplified LAN however it becomes more complex when you have an advanced LAN\WAN setup. Most admins do not have enough need to setup DNS correctly to handle bonjour over multiple broadcast domains.
     
  3. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #3
    Your University may be restricting services it doesn't recognize. So what works at home on your WAN may fail elsewhere. I noticed this problem in a public library. I didn't investigate this further.

    As I recall, Bonjour will try to use Bluetooth when the LAN fails. Problem is that the iOS Simulator does not allow use of Bluetooth so you require two real devices to test this. They also need to be near each other.

    Sykte mentioned the game kit framework. This is suppose to simplify coding. Don't let the name limit your investigation of it.
     

Share This Page