On Sat, Mar 22, 2014 at 08:50:57AM -0700, Brian C wrote:
> > @@ -60,6 +60,13 @@ Connection.prototype.connect = function(port, host) {
> >      self.emit('end');
> >    });
> >  
> > +  this.stream.on('close', function() {
> > +    // TODO: avoid emitting 'end' twice ?
> 
> is this TODO still needed?  did you already fix this for v0.8.x and v0.10.x?

My problem was fixed and tested with both v0.8 and v0.10

The TODO is needed as it asks for an opinion from you :)
You see that both "end" and "close" events trigger "end".
Do you think that's a problem ?
Node-0.8 only sends "close".

client.js effects on 'end' are all protected by double-call
except for further sending 'end' to upper levels.

the pool calls 'destroy' and receiving 'end' from client but
is protected by the double call with this:

          // Remove connection from pool on disconnect
          client.on('end', function(e) {
            // Do not enter infinite loop between pool.destroy
            // and client 'end' event...
            if ( ! client._destroying ) {
              pool.destroy(client);
            }
          });

So is not a problem, but you _migt_ not like the double 'end'
event anyway.

--strk;