-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle mDNS (avahi-daemon) stop #56
Comments
Heh, good question. Not sure if it possible at all. I'll look into it. On Dec 17, 2012, at 15:33, thunder notifications@github.com wrote:
|
It's possible in python for example. Calibre, the e-book library management, handle such thing right. But i don't know how :) |
Well, obviously it's possible. What I meant is: It might not be fixable in mdns. If that's the case I'll report it upstream to the node/libuv guys... On Dec 17, 2012, at 17:37, thunder notifications@github.com wrote:
|
Well, for me it doesn't crash. If the daemon is down while creating a browser I get an exception. When the daemon goes down while browsing I get an error event. Both is easy to handle: var mdns = require('./lib/mdns');
try {
var b = mdns.createBrowser(mdns.tcp('http'));
} catch (ex) {
console.log('something bad happened. we better start over.')
}
b.on('error', function(error) {
console.log('something bad happened. we better start over.')
});
b.start(); The error is a bit vague though. But I can't change that. mdns only forwards what the underlying library reports. However, in case of an unknown error it is probably best to set up a new browser and start over anyway. The only improvement on the mdns side I can think of is to attach the actual error code to the exception/error object. The source code looks a bit like I've tried that already and it probably wasn't that simple. However, I'll give it another try (See #57)... Tested on ubuntu 11.10, node 0.8.12, mdns 1.0.0. |
Sorry you arre right : no crash (i missed to attach the 'error' handler). The solution is to restart the browser/createAdvertisement. I will try this. back soon. Thx |
below code to handle avahi errors :
Thx for your help |
You're welcome. |
Hello, how is it possible to handle a stop/start of hte mDNS daemon (avahi-daemon for me on debian).
In case of daemon stop, what can we do to restart the advertising service?
Thx.
The text was updated successfully, but these errors were encountered: