如何注册Mono.ZeroConf服务? [英] How to register a service with Mono.ZeroConf?
问题描述
我想在 http://www.mono-project.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库的项目。通过使用住进低吼在谷歌代码(视窗项目二进制这似乎是最新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.
因此,一个明显的变通会抢二进制文件(单声道.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屋!