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
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.
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().