Stopping Bonjour Services

Discussion in 'iOS Programming' started by ppilone, Aug 6, 2009.

  1. macrumors 6502

    Jan 20, 2008
    Hey guys,

    I'm having a tough time properly stopping bonjour services when an app is running on the device. Noticed this problem with my app so I downloaded the WiTap example and it's having the same problem.

    The apps publish a bonjour service (sometimes it works) but when the service is stopped the service remains listed in a Bonjour Browser app I'm running on my laptop. The only way to stop the services is to restart bonjour. When either WiTap or my app are run in the simulator they behave correctly (the services start and stop correctly).

    Any thoughts on how to correctly unregister the service from the phone? Or why they work correctly in the simulator but terribly on the device?
  2. macrumors 68030


    Sep 2, 2008
    [netService stop];
    [netService release];
    works reliably for me. I use the Safari browser to tell that the service is available or not. I'm publishing a web server.
  3. thread starter macrumors 6502

    Jan 20, 2008
    That's what I'd expect to use (and do use) but i still run into the problem. Here is a screenshot of the Bonjour Browser I'm using to search for services - you can see that the witap service is available even though the app is no longer running on the device. When I run the app in the simulator it behaves correctly.

    Attached Files:

Share This Page