Using Apples Bonjour from .NET?

I have an iPhone app that is published through Bonjour. Mac compatible, they synchronize and share data. Now I need to port this small Mac app to Windows. I decided to go with .NET (because this is what I know).

The application is not complicated, but Im in the early stages. I need to view / open Bonjour services. For this task, Ive downloaded Mono.Zeroconf and Apples latest SDK (which includes a couple of C # samples).

I really don’t paste the code because Im really copy / paste samples. In fact, Mono.Zeroconf has MZClient.exe, which can be used to test the "whole API".

My first test was - in the same window - open two cmd.exe and start MZclient, registering the service, and on the other - start it and "open".

This does not work.

Here is the server:

C:\MZ>MZClient -v -p "_http._tcp 80 mysimpleweb" *** Registering name = 'mysimpleweb', type = '_http._tcp', domain = 'local.' *** Registered name = 'mysimpleweb' 

On another terminal:

 c:\MZ>MZClient -v -t "_http._tcp" Creating a ServiceBrowser with the following settings: Interface = 0 (All) Address Protocol = Any Domain = local Registration Type = _http._tcp Resolve Shares = False Hit ^C when you're bored waiting for responses. 

And here it is. Nothing has happened. Ive, of course, tried with various services, but to no avail. Even played a little with this subject area. Remember that this is the same box. I tried on another computer because it was a virtual machine inside OSX, so I went ahead and tried a “clean” XP victory. Nothing.

note : I have the Apple Bonjour Service app (up and down) as well as the Apple SDK (installed later).

Given that this did not help, I went ahead and decided to try the Apple SDK with Interop and a few pre-compiled samples (and its source code).

The story, neither mDSNBrowser.exe, nor SimpleChat.exe do not work / do not see / do not open anything.

My box is Win7 in Parallels, but that doesn’t seem to affect anything, given that native XP has the same problems.

What am I doing so terribly wrong?

+7
c # bonjour
source share
2 answers

I used Zeroconf NetServices for Zeroconf inside .NET. Assuming that you enable Bonjour through your firewall and that your network equipment is multicastable, the biggest problem has always been the unreliability of the Apple Bonjour service. Corrupted working code will not work, and the solution should restart the Bonjour service. So, check your network hardware, check your firewall, but end up restarting Bonjour a few times. This does not always work on the first, second or third attempt, etc.

+4
source share

Here are a few important links, such as the NuGet version, the original version in Git, and the currently downloaded version for Windows. The NuGet package did not work for me, so I downloaded the source, made the recommended changes and recompiled.

How to register a service using Mono.ZeroConf?

http://bryanprice.info/2011/01/29/mono-zeroconf-on-windows/

+1
source share

All Articles