Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ppilone

macrumors 6502
Original poster
Jan 20, 2008
361
0
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?
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Code:
[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.
 

ppilone

macrumors 6502
Original poster
Jan 20, 2008
361
0
Code:
[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.

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.
 

Attachments

  • Picture 3.png
    Picture 3.png
    47.9 KB · Views: 84
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.