From 736b570bd624cb33e787686bbfeb9724f6ac398a Mon Sep 17 00:00:00 2001 From: Simon Olofsson Date: Tue, 27 Aug 2019 01:16:42 +0200 Subject: [PATCH] Document `reconnect` option. (#504) * Fix typo. * Document `reconnect` option. Fixes #392 --- docs/client.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/client.md b/docs/client.md index 977852d..3aee755 100644 --- a/docs/client.md +++ b/docs/client.md @@ -32,6 +32,7 @@ client is: |tlsOptions |Additional options passed to TLS connection layer when connecting via `ldaps://` (See: The TLS docs for node.js)| |idleTimeout |Milliseconds after last activity before client emits idle event| |strictDN |Force strict DN parsing for client methods (Default is true)| +|reconnect |Try to reconnect when the connection gets lost (Default is false)| ### Note On Logger @@ -48,9 +49,17 @@ Known compatible loggers are: ## Connection management As LDAP is a stateful protocol (as opposed to HTTP), having connections torn -down from underneath you is can be difficult to deal with. Several mechanisms +down from underneath you can be difficult to deal with. Several mechanisms have been provided to mitigate this trouble. +### Reconnect + +You can provide a Boolean option indicating if a reconnect should be tried. For +more sophisticated control, you can provide an Object with the properties +`initialDelay` (default: `100`), `maxDelay` (default: `10000`) and +`failAfter` (default: `Infinity`). +After the reconnect you maybe need to [bind](#bind) again. + ## Common patterns