mcavage/node-ldapjs — Issue #30: always get an "err" from `client.unbind(function(err) {})`
Author: trentm
Created: 2011-11-04 17:05:31+00:00
State: open

My example code:

```
var ldap = require('ldapjs');

var client = ldap.createClient({
url: 'ldaps://10.88.88.50:636'
});

var opts;
opts = {
filter: '(login=*)',
scope: 'sub'
};

client.bind('XXX', 'XXX', function(err) {
client.search('o=smartdc', opts, function(err, res) {
res.on('searchEntry', function(entry) {
console.log('entry: ' + JSON.stringify(entry.object));
});
res.on('searchReference', function(referral) {
console.log('referral: ' + referral.uris.join());
});
res.on('error', function(err) {
console.error('error: ' + err.message);
});
res.on('end', function(result) {
console.log('status: ' + result.status);
client.unbind(function(err) {
console.error('error in unbind:', err.message);
});
});
});
});
```

Result of running that:

```
entry: {"dn":"uuid=930896af-bf8c-48d4-885c-6573a94b1853, ...
entry: {"dn":"uuid=e966936c-0667-11e1-89bb-6b7f6d694e75, ...
entry: {"dn":"uuid=7b23ae63-37c9-420e-bb88-8d4bf5e30455, ...
status: 0
error in unbind: 10.88.88.50 closed
```