Skip to content

Linux compatibility #14

@ygina

Description

@ygina

I am trying to run the examples on a Linux distro:

$ uname -a
Linux [HOSTNAME] 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Setup starting from c80301a:

$ sudo apt-get install libavahi-compat-libdnssd-dev libavahi-compat-libdnssd1  # apt search libavahi-compat

Output:

$ cargo r --example browse
[2020-09-07T17:16:28Z INFO  browse] Starting browser...
*** WARNING *** The program 'browse' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/proje
cts/avahi-compat.html>
<END>
$ cargo r --example register
Registering service...
*** WARNING *** The program 'register' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
<END>
$ avahi-browse -a | grep MyRustService
+ enp7s0 IPv4 MyRustService                                 Web Site             local
+     lo IPv4 MyRustService                                 Web Site             local

The warning seems harmless, and I can confirm the service was actually registered using avahi-browse. But I expect log output from the callbacks like I get on MacOS. Otherwise the browse binary is unable to interact with the discovered hosts. See MacOS output from browse:

macos$ cargo r --bin browse
[2020-09-07T17:19:49Z INFO  browse] Starting browser...
[2020-09-07T17:19:51Z INFO  browse] Added: if: 8 name: MyRustService type: _http._tcp. domain: local.
[2020-09-07T17:19:51Z TRACE astro_dnssd::browser] Got TXT: TXTHash { data: [11, 115, 116, 97, 116, 117, 115, 61, 111, 112, 101, 110] }
[2020-09-07T17:19:51Z TRACE astro_dnssd::browser] MyRustService._http._tcp.local. - [HOSTNAME].local. service resolved
[2020-09-07T17:19:51Z INFO  browse] Addr: 10.128.162.203:2048
[2020-09-07T17:19:51Z INFO  browse] Addr: [fe80::f2:3585:957:c9b3]:2048
[2020-09-07T17:19:51Z INFO  browse] Resolved service: ResolvedService { full_name: "MyRustService._http._tcp.local.", hostname: "[HOSTNAME].local.", port: 2048, txt_record: Some(TXTHash { data: [11, 115, 116, 97, 116, 117, 115, 61, 111, 112, 101, 110] }), interface_index: 8 } status: Ok(Some([111, 112, 101, 110]))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions