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 注册服务?
基础教程推荐
- WPF 模态进度窗口 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
