question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

the client reconnection is not documented

See original GitHub issue

I was having some problems connecting to a balanced ldap and reading the code I found the solution undocumented.

var client = ldap.createClient({
        url: config.ldap.url,
        reconnect:true
});

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
liyuntaocommented, Jun 16, 2017

A little late, maybe. For others enter this issue later:

    // e.g. in your client's class constructor
    
    this.ldapClient = ldap.createClient({
        url: ldap_url,
        reconnect: {
            initialDelay: 100,
            maxDelay: 1000,
            failAfter: 10
        }
    });

    const client = this.ldapClient;
    // do a rebind when reconnect
    this.ldapClient.on('connect', function () {
        client.bind(ldap_user, ldap_pwd, err => {
            if (err) {
                logger.error('error while ldap binding' + err);
            }
        });
    });
1reaction
johno1985commented, Sep 6, 2019

A little late, maybe. For others enter this issue later:

    // e.g. in your client's class constructor
    
    this.ldapClient = ldap.createClient({
        url: ldap_url,
        reconnect: {
            initialDelay: 100,
            maxDelay: 1000,
            failAfter: 10
        }
    });

    const client = this.ldapClient;
    // do a rebind when reconnect
    this.ldapClient.on('connect', function () {
        client.bind(ldap_user, ldap_pwd, err => {
            if (err) {
                logger.error('error while ldap binding' + err);
            }
        });
    });

Will this cause bind to execute twice on the first connect?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Client Reconnection and Session Reattachment - ActiveMQ
In this case any sessions will no longer exist on the server and it won't be possible to 100% transparently re-attach to them....
Read more >
IT27273: MQ Client Applications configured for reconnection ...
IT27273: MQ Client Applications configured for reconnection do not reconnect when the Queue Manager fails over using MSCS.
Read more >
Specifying a reconnection strategy - Diffusion Documentation
The reconnection behavior of a client session can be configured using reconnection strategies. A reconnection strategy is applied when the session enters the ......
Read more >
Not receiving document updates on network disconnect and ...
Reconnect after 5 minutes; Here my guess is that the server would have reset the GRPC connection from its end since it cannot...
Read more >
Remote Desktop client disconnects and can't reconnect to the ...
Remote Desktop disconnected. Because of a security error, the client could not connect to the remote computer. Verify that you are logged onto ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found