Node-ldapjs: No error event when reconnect is set to true

Created on 21 Nov 2016  路  3Comments  路  Source: ldapjs/node-ldapjs

Hi,

I am trying to connect the ldapjs client with our LDAP server.
When the server is not reachable/available, the correct error is thrown.
For example:

{ Error: connect ECONNREFUSED 127.0.0.1:389 at Object.exports._errnoException (util.js:1007:11) at exports._exceptionWithHostPort (util.js:1030:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14) code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 389 }

But when I set reconnect: true in options, no error is thrown on initial connect and instead the application hangs up endless. Is there any way to get around this?

Best regards
Philipp

has-pr

Most helpful comment

I'd like to echo the request to add the reconnect option to the documentation. This undocumented option is useful in case you need to call bind() a second time on a Client object after calling unbind().

All 3 comments

The source code of the client showed, that the reconnect attribute also accepts an object as value and so you easily can do (for example) the following:

ldap.createClient({
    "reconnect": {
        "initialDelay": 100,
        "maxDelay": 500,
        "failAfter": 5
    }
});

Please add the reconnect opportunity to your documentation.

I'd like to echo the request to add the reconnect option to the documentation. This undocumented option is useful in case you need to call bind() a second time on a Client object after calling unbind().

This is addressed in #504.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sorccu picture sorccu  路  5Comments

phi1ipp picture phi1ipp  路  4Comments

ifroz picture ifroz  路  8Comments

gdw2 picture gdw2  路  3Comments

RaymondLC92 picture RaymondLC92  路  5Comments