Minor update to ClientPool event pass-through

- Allow event pass-through when performing ClientPool.bind
- Rename createPool parameter for better readability
- Fix jsstyle error
This commit is contained in:
Patrick Mooney 2013-11-28 14:08:17 -06:00
parent e03d40957e
commit f5ba81dc38
2 changed files with 5 additions and 5 deletions

View File

@ -163,7 +163,7 @@ function setupSocket(socket, opts) {
socket.on('error', function onError(err) {
if (log.trace())
log.trace({err: err}, 'error event: %s', new Error().stack);
if (opts.connectTimer) {
clearTimeout(opts.connectTimer);
opts.connectTimer = false;

View File

@ -31,7 +31,7 @@ var RETURN_VAL_OPS = [
///--- Internal Functions
function createPool(options, self) {
function createPool(options, clientpool) {
assert.ok(options);
return pooling.createPool({
@ -47,13 +47,13 @@ function createPool(options, self) {
client.on('error', function (err) {
client.removeAllListeners('connect');
client.removeAllListeners('connectTimeout');
self.emit('error', err);
clientpool.emit('error', err);
return callback(err);
});
client.on('connectTimeout', function () {
client.removeAllListeners('connect');
self.emit('connectTimeout');
clientpool.emit('connectTimeout');
});
client.once('connect', function onConnect() {
@ -248,7 +248,7 @@ ClientPool.prototype.bind = function bind(dn, creds, controls, callback) {
self.options.bindControls = null;
return this.pool.shutdown(function () {
self.pool = createPool(self.options);
self.pool = createPool(self.options, self);
return self.pool.acquire(function onAcquire(err, client) {
if (err)