@@ -20,6 +20,10 @@ The code to create a new client looks like:
20
20
url: ['ldap://127.0.0.1:1389', 'ldap://127.0.0.2:1389']
21
21
});
22
22
23
+ client.on('error', (err) => {
24
+ // handle connection error
25
+ })
26
+
23
27
You can use ` ldap:// ` or ` ldaps:// ` ; the latter would connect over SSL (note
24
28
that this will not use the LDAP TLS extended operation, but literally an SSL
25
29
connection to port 636, as in LDAP v2). The full set of options to create a
@@ -70,6 +74,25 @@ more sophisticated control, you can provide an Object with the properties
70
74
` failAfter ` (default: ` Infinity ` ).
71
75
After the reconnect you maybe need to [ bind] ( #bind ) again.
72
76
77
+ ## Client events
78
+
79
+ The client is an ` EventEmitter ` and can emit the following events:
80
+
81
+ | Event | Description |
82
+ | ---------------| ----------------------------------------------------------|
83
+ | error | General error |
84
+ | connectRefused | Server refused connection. Most likely bad authentication |
85
+ | connectTimeout | Server timeout |
86
+ | connectError | Socket connection error |
87
+ | setupError | Setup error after successful connection |
88
+ | socketTimeout | Socket timeout |
89
+ | resultError | Search result error |
90
+ | timeout | Search result timeout |
91
+ | destroy | After client is disconnected |
92
+ | end | Socket end event |
93
+ | close | Socket closed |
94
+ | connect | Client connected |
95
+ | idle | Idle timeout reached |
73
96
74
97
## Common patterns
75
98
0 commit comments