Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 0dab63c

Browse files
committed
docs: add client events table
1 parent bb475ab commit 0dab63c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/client.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ The code to create a new client looks like:
2020
url: ['ldap://127.0.0.1:1389', 'ldap://127.0.0.2:1389']
2121
});
2222

23+
client.on('error', (err) => {
24+
// handle connection error
25+
})
26+
2327
You can use `ldap://` or `ldaps://`; the latter would connect over SSL (note
2428
that this will not use the LDAP TLS extended operation, but literally an SSL
2529
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
7074
`failAfter` (default: `Infinity`).
7175
After the reconnect you maybe need to [bind](#bind) again.
7276

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 |
7396

7497
## Common patterns
7598

0 commit comments

Comments
 (0)