Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to register a service with Mono.ZeroConf?

Tags:

c#

mono

zeroconf

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!

like image 507
pablo Avatar asked Mar 01 '09 13:03

pablo


2 Answers

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.

like image 120
Kevin McMahon Avatar answered Oct 03 '22 01:10

Kevin McMahon


The binaries at mono-project.com/Mono.Zeroconf are out of date and still contain code that causes this problem. The most recent code (with all the fixes) is at this link but require you to compile the code yourself.

like image 42
dsfgsho Avatar answered Oct 03 '22 01:10

dsfgsho