如何向 Mono.ZeroConf 注册服务?

How to register a service with Mono.ZeroConf?(如何向 Mono.ZeroConf 注册服务?)
本文介绍了如何向 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 注册服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)