如何向 Mono.ZeroConf 注册服务? [英] How to register a service with Mono.ZeroConf?

查看:9
本文介绍了如何向 Mono.ZeroConf 注册服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 http://www.mono-project 测试 ZeroConf 示例.com/Mono.Zeroconf.

我正在运行 OpenSuse 11 和 Mono 2.2.

I'm running OpenSuse 11 and Mono 2.2.

我的服务器代码是:

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();
        }
    }
}

但是我无法使用示例客户端浏览器代码或 mzclient 找到我的注册服务.

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

谢谢!

推荐答案

我也尝试过使用 Mono.Zeroconf 项目页面并从源代码构建库以在 Windows 上使用,并且无法发布其他客户端可找到的服务.我尝试了网站上的示例代码和提供的 MZClient.

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.

经过一番挖掘,我发现了一个使用 Mono.Zeroconf 库的项目.通过使用在 Google Code(其中似乎是最新版本 0.9.0)我能够使用示例代码和 MZClient 成功发布可查找的服务.

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.

因此,一个明显的解决方法是从该项目中获取二进制文件(Mono.Zeroconf 和 Mono.Zeroconf.Providers.Bonjour)并使用它们而不是项目提供的那些.

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.

这篇关于如何向 Mono.ZeroConf 注册服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆