Skip to content
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

Please add this._socket.on('error') in TCPSocket.prototype.bind #97

Open
kupson opened this issue Jul 3, 2015 · 2 comments
Open

Please add this._socket.on('error') in TCPSocket.prototype.bind #97

kupson opened this issue Jul 3, 2015 · 2 comments

Comments

@kupson
Copy link

kupson commented Jul 3, 2015

Hi,

Please consider adding error listener/emitter on TCP sockets. Right now I'm getting errors like below:

2015-06-30_16:14:17.57533 events.js:85
2015-06-30_16:14:17.57541       throw er; // Unhandled 'error' event
2015-06-30_16:14:17.57542             ^
2015-06-30_16:14:17.57544 Error: connect ETIMEDOUT
2015-06-30_16:14:17.57545     at exports._errnoException (util.js:746:11)
2015-06-30_16:14:17.57546     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)

As a quick workaround I monkey-patched TCPSocket:

var native_dns_utils = require('native-dns/lib/utils');
native_dns_utils.TCPSocket.prototype._monkey_catchMessages = native_dns_utils.TCPSocket.prototype.catchMessages;
native_dns_utils.TCPSocket.prototype.catchMessages = function () {
    var self = this;
    this._socket.on('error', function(err) {
        self.bound = false;
        self.emit('close', err);
    });
    this._monkey_catchMessages();
};

Kind Regards,
Rafal Kupka

@panta82
Copy link

panta82 commented Oct 11, 2015

I just got stung by this. Causes hard to debug crashes of the entire application. Not cool.

@nebulade
Copy link

nebulade commented Aug 10, 2016

Hit the same issue, looks like this module is not maintained anymore.

FrancisTurner added a commit to FrancisTurner/native-node-dns that referenced this issue May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants