tags:

views:

605

answers:

5

Hi,

I'm trying to test the ZeroConf sample at http://www.mono-project.com/Mono.Zeroconf.

I'm running OpenSuse 11 and Mono 2.2.

My server code is:

using System;
using Mono.Zeroconf;

namespace zeroconftestserver
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            RegisterService service = new RegisterService ();
            service.Name = "test server";
            service.RegType = "_daap._tcp";
            service.ReplyDomain = "local.";
            service.Port = 6060;

            // TxtRecords are optional
            TxtRecord txt_record = new TxtRecord ();
            txt_record.Add ("Password", "false");
            service.TxtRecord = txt_record;

            service.Register();
            Console.WriteLine("Service registered!");
            Console.ReadLine();
        }
    }
}

But I can't find my registered service with the sample client browser code nor with mzclient.

Thanks!

A: 

Under Linux, wouldn't you be using avahi-browse-domains instead of mzclient?

Paul Betts
Not sure, just following the default sample
pablo
+2  A: 

He is using mzclient to test his Mono.Zeroconf code above. The entire point of Mono.Zeroconf is to provide cross platform, multiple mDNS provider support (Avahi and Bonjour).

There appears to be an issue with the EntryGroup DBus Avahi API and I am looking into it in Mono.Zeroconf. I'll post a solution here, as well as make a new Mono.Zeroconf release (I am the maintainer of the project) when I figure out the issue.

Aaron Bockover
A: 

Did you find a fix? I have the same issue here, mzclient (Revision 144759) doesn't seem to register and/or discover services. I checked with the BonjourFoxy browser, but it doesn't show anything either.

Markus
A: 

I've also tried to use the binaries provided at the Mono.Zeroconf project page and building the libs from source for use on Windows and was unable to publish a service that was findable by other clients. I tried both the example code on the site and the MZClient provided.

After a little more digging I found a project that used to the Mono.Zeroconf libs. By using the binaries checked into the Growl for Windows project at Google Code (which appear to be the latest version 0.9.0) I was able to successfully publish a findable service with both the sample code and MZClient.

So an apparent work around would be to grab the binaries (Mono.Zeroconf and Mono.Zeroconf.Providers.Bonjour) from that project and use those instead of the ones provided by the project.

Kevin McMahon
A: 

I wasn't able to get a service published either. I looked through the code and there is a bug in Service.cs, the UPort setter:

this.port = (ushort) IPAddress.HostToNetworkOrder((int) value);  //overflow, port is always 0

It should be

this.port = (ushort) IPAddress.HostToNetworkOrder((short) value);
Frankenspank