How to register a service with Mono.ZeroConf?

前端 未结 5 1585
别跟我提以往
别跟我提以往 2021-02-04 18:47

I\'m trying to test the ZeroConf sample at http://www.mono-project.com/Mono.Zeroconf.

I\'m running OpenSuse 11 and Mono 2.2.

My server code is:

u         


        
相关标签:
5条回答
  • 2021-02-04 19:11

    He is using mzclient to test his Mono.Zeroconf code above. The entire point of Mono.Zeroconf is to provide cross platform, multiple mDNS provider support (Avahi and Bonjour).

    There appears to be an issue with the EntryGroup DBus Avahi API and I am looking into it in Mono.Zeroconf. I'll post a solution here, as well as make a new Mono.Zeroconf release (I am the maintainer of the project) when I figure out the issue.

    0 讨论(0)
  • 2021-02-04 19:19

    The binaries at mono-project.com/Mono.Zeroconf are out of date and still contain code that causes this problem. The most recent code (with all the fixes) is at this link but require you to compile the code yourself.

    0 讨论(0)
  • 2021-02-04 19:27

    Recompiling after updating the source from the following link solved the issue

    https://github.com/mono/Mono.Zeroconf/tree/master/src

    0 讨论(0)
  • 2021-02-04 19:30

    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.

    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.

    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.

    0 讨论(0)
  • 2021-02-04 19:31

    I wasn't able to get a service published either. I looked through the code and there is a bug in Service.cs, the UPort setter:

    this.port = (ushort) IPAddress.HostToNetworkOrder((int) value);  //overflow, port is always 0
    

    It should be

    this.port = (ushort) IPAddress.HostToNetworkOrder((short) value);
    
    0 讨论(0)
提交回复
热议问题