andris9/simplesmtp — pull request #8 by julian1828 (2012-05-24 08:11:55+00:00)
Title: Enabled access to connection object during creation in a pool

Like I noted in the code, I changed the _createConnection (line 158) function of pool.js to emit an event called 'connectionCreated' to the current connectionPool object. This will enable me critical insight to why a connection fails, etc. Now I realize that this may open the door for a someone to do something to the connection that may screw with the control the pool offers. So I don't know if opening up the entire connection is correct, maybe just exposing the start, error, and end events make sense. Any thoughts?

Example:

```
pool.on('connectionCreated', function(connection) {

connection.on('error', function(err) {
console.log('connection errored: ', err);
});

connection.on('end', function() {
console.log('connection end');
});

});
```