ho questo campione Node.js script:Raspberry PI mdns getaddrinfo 3008 errore
var mdns = require('mdns');
var browser = mdns.createBrowser(mdns.tcp('http'));
browser.on('error', function (error) {
console.log("error");
console.log(error);
});
browser.on('serviceUp', function (service) {
console.log("serviceUp");
console.log(service);
});
browser.start();
Sul mio Mac che sta funzionando bene, e due servizi è trovato. Se corro lo stesso copione esatto sul mio Raspberry PI 2 esecuzione Raspbean (collegato alla stessa rete), ottengo questo output:
[email protected] ~ $ node mdns.js
*** WARNING *** The program 'node' 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/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in 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/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
error
{ [Error: getaddrinfo -3008] code: -3008, errno: -3008, syscall: 'getaddrinfo' }
error
{ [Error: getaddrinfo -3008] code: -3008, errno: -3008, syscall: 'getaddrinfo' }
A issue on the mdns GitHub, afferma che è giusto ignorare gli avvertimenti.
Ma che dire dei due errori? È una specie di problema di configurazione sul mio Raspberry PI?
Solo per vostra informazione, i codici di errore di 'getaddrinfo' possono essere tradotti in testo leggibile tramite' gai_strerror', definito in ['netdb.h'] (http://pubs.opengroup.org/onlinepubs/7908799/ XNS/netdb.h.html). Sfortunatamente, il codice di errore -3008 è rappresentato come "Errore sconosciuto". La mia ipotesi è che il codice di errore provenga da qualche altra parte rispetto alla funzione 'getaddrinfo', forse qualche chiamata di sistema sottostante o qualsiasi altra cosa ... –
quale versione di node.js è in esecuzione sul raspberry pi? – flotto