socket.io listen / listening event
<p>I am surprised looking at the <code>socket.io</code> docs that there is no event that is fired by socket.io when it is bound to a port...I am looking for a "listen" / "listening" event...</p>

<p><a href="http://socket.io/docs/server-api/" rel="nofollow">http://socket.io/docs/server-api/</a></p>

<p>I have this simple module that is initialized with a http.Server instance:</p>

<pre><code>var io = require('socket.io');

var socketServer = null;

function getSocketServer(httpServer) {

    if (socketServer === null) {

        if (httpServer == null) {
            throw new Error('need to init socketServer with http.Server instance');
        }

        socketServer = io.listen(httpServer);
    }

    return socketServer;

}


module.exports = {
    getSocketServer:getSocketServer
};
</code></pre>

<p>when I require this module, I want to listen for a 'listening' event.</p>

<p>Something like:</p>

<pre><code>var socket = require('./socket-cnx').getSocketServer();

socket.on('listening',function(err){

});
</code></pre>

<p>I suppose the primary reason is because the <code>on</code> API is used for event names.</p>