sidorares/nodejs-mysql-native — pull request #65 by twistdigital (2012-05-11 12:55:40+00:00)
Title: Added ping command and connect listener

Allows users to add listeners which fire when the net.createConnection fires its onConnect listener.

The alternative would be to say

var c = mysql.createTCPConnection(host, port);
c.on('connect', someCallback);

But because createTCPConnection goes though all the SocketClient stuff, augmenting commands etc, it's likely that the connect event will have fired already by the time the listener is added. Instead we can now do this:

var c = mysql.createTCPConnection(host, port, someCallback);

and have the connect listener added immediately.