How to register a service with 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 注册服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何向 Mono.ZeroConf 注册服务?
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 输入按键事件处理程序 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
