var net = require('net')
  , SocketIo = {};

/**
 * Generates a SocketHelper
 *
 * https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO
 *
 * @constructor
 * @param {Object} options
 */
var SocketHelper = function(app, config) {
    this.initialize(app, config);
}

/**
 * Initializes properties
 *
 * @constructor
 * @param {Object} options
 */
SocketHelper.prototype.initialize = function(app, appConfig) {

  // This would allow Socket.IO to listen on the same port as the server
  SocketIo = require('socket.io').listen(app, {'log level': appConfig.socket_loglevel});
  console.log("Socket.IO listening on port " + appConfig.port);

  SocketIo.sockets.on('connection', function(socket) {
    var id = setInterval(function() {
      socket.volatile.emit('timestamp', JSON.stringify(new Date()), function() {  }); // ignore errors
    }, 500);
    socket.on('close', function() {
      console.log('stopping client interval');
      clearInterval(id);
    })
  });
};


// Export SocketHelper constructor
module.exports.SocketHelper = SocketHelper;

@@ -38,16 +38,92 @@
  = %7B%7D;%0A%0A
+// http://mattmueller.me/blog/quick-tip-node-js-socket-io-authentication%0A  %0A
 /**%0A * G

Add link in comment describing how I might tie socket to a session