You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just hit this too; you write a connect function as per the example in the README.md and it locks the whole VM up, so it's not yielding at all. Nasty.
I was able to work around this as follows, instead of this (which locks nodejs up):
newLDAP({connect: function(){this.simplebind({binddn: binddn,password: password,},function(err){console.log("this is never called");});console.log("this is never called; this.simplebind never returns");},});
I instead used process.nextTick like this, which then works as expected. Obviously connect will complete without the bind necessarily finishing but in my case this is not an issue as I wrapped the whole thing in a promise, which can be resolved on successful bind, thus hiding the whole problem from the caller:
newLDAP({connect: function(){process.nextTick(()=>{this.simplebind({binddn: binddn,password: password,},function(err){console.log("this IS now called, with an error if something went wrong");});console.log("this IS now called; this.simplebind returns");});},});
I guess there is a deadlock, or a race condition that stops bind working in the connect call synchronously, but I've not looked into it.
I surely miss something.
I use
slapd
ondebian 8
.When I put
this.bind
intoconnect
, it never finishes (even if I putconnecttimeout
to 1 or 10 or whatever).On the other hands
ldap.bind
works well in thenew LDAP
callback.const LDAP = require('ldap-client');
I'm stuck, please could you help me to understand or explain best what is happening?
The text was updated successfully, but these errors were encountered: