🤖 Merge PR #46448 [ldapjs] add missing close method to Server by @ArisuOngaku

This commit is contained in:
Alice Gaudon 2020-08-03 17:31:26 +02:00 committed by GitHub
parent 0ae251399b
commit d7003e1d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -309,6 +309,8 @@ export interface Server extends EventEmitter {
*/
listenFD(fileDescriptor: any): void;
close(callback: () => void): this;
bind(mount: string, ...cbHandlers: any[]): void;
add(mount: string, ...cbHandlers: any[]): void;

View File

@ -151,3 +151,14 @@ let approximateFilter = new ldap.ApproximateFilter({
value: 'foo'
});
approximateFilter.matches({ cn: 'foo' });
let server = ldap.createServer();
server.listen(1389, '127.0.0.1', () => {
// Do stuff
// Close the server gracefully
server.close(() => {
// Server closed
});
});