Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
587 views
in Technique[技术] by (71.8m points)

api - bonjour for iphone

I would like to know whether bonjour is a public or private api?Can we use it in our apps directly.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Bonjour is handled by the NSNetServices and CFNetServices APIs, which you can read more about here. These are Cocoa and Core Foundation interfaces, and are publicly available for use in Mac and iPhone applications. As has been pointed out, many applications make use of this to do iPhone - iPhone networking (Game Kit is layered on top of Bonjour, for example) or Mac - iPhone data syncing (such as for Marcus Zarra's ZSync library).

Bill Dudney has created a stripped-down Bonjour server class for the iPhone, which he describes here. I created a matching Mac application which communicates with his test application and can be downloaded from here. Apple's WiTap sample code demonstrates how to use Bonjour to network two iPhones together.

I devoted a section of the class I teach on iPhone development to Bonjour networking, for which the course notes can be downloaded in VoodooPad format here (go to the Networking class for coverage of this).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...