views:

156

answers:

3

Am I really restricted by programming languages? I can imagine that, to use Bonjour, I need to have special libraries which could be not available for any language. So, then I need to use those languages which have corresponding libraries. As the second option, I can imagine, that Bonjour provide an interface which can be used almost by any language (for example Bonjour saves information in a special file or in environment variables and than I can use most of the languages to access this information).

P.S. I have a particular interest in PHP.

+1  A: 

You will have better luck searching for "ZeroConf", which is the name of the actual protocol, rather than "Bonjour", which is Apple's specific implementation of the protocol.

Teddy
Well, in my case I need to work with Bonjour (I know it will be installed on Windows XP and I need to use it).
Roman
Anything for ZeroConf should work with Bonjour.
ceejayoz
ceejayoz, I need to use Bonjour. And I think this software has a special interface for "communication" with programming languages. And I think that another implementation of ZeroConf will have another interface. Isn't? I can be wrong.
Roman
+2  A: 

Plenty of languages have ZeroConf bindings, including Java and .Net, and there's an example of using it in Python here. It uses D-Bus to talk to the daeomon. This list of bindings for D-Bus includes PHP, Python, Perl, Java, .Net, C++, Haskell, OCaml, Squeak, and plenty more besides. There's even a Pascal binding!

So no, you are not very restricted by programming languages.

Peter Westlake
Is D-Bus a software implementing zeroconf? Is it something like Bonjour? Or it should be (can be) used in addition to the Bonjour? In my particular case I need to use Bonjour.
Roman
D-Bus is a way for processes to talk to each other. So you would use a D-Bus library to talk to your Bonjour/ZeroConf service. It's a bit like COM. Since you are on Windows, you'll want to use COM, as Lachlan suggests.
Peter Westlake
+1  A: 

Apple's Bonjour for Windows SDK is installed as a COM component, which can be called from PHP via the COM functions.

Sample code in several languages is installed with the SDK. While PHP is not one of them, the examples should be readable.

Another source of information on the API is the Bonjour documentation in the Mac OS X reference Library.

Lachlan Roche
I have installed Apple's Bonjour for Windows SDK. In the "Samples" folder there is "C", "CS", "Java", "VB". No PHP.
Roman
@Roman: So? Just read and adapt.
Ignacio Vazquez-Abrams