lib/server.js
function monitor(req, res) {
  var socket = req.conn.socket
    , args = [req.cmd].concat(req.args)
    , t = systime()
    , str;

  // quote command and args
  args = args.map(function(arg) {
    return '"' + arg + '"';
  })

  // TODO: figure out meaning of ip/host prefix: [0

  // build up the monitor simple string response
  str = new String(
    util.format(Constants.FORMAT.MONITOR,
      t.s, t.m,
      socket.remoteAddress, socket.remotePort, args.join(' ')));

  // emit the event, listening connections will send replies
  // to clients registered for monitor
  this.emit('monitor', str);
}
function monitor(req, res) {
  var socket = req.conn.socket
    , args = [req.cmd].concat(req.args)
    , t = systime()
    , str;

  // quote command and args
  args = args.map(function(arg) {
    return '"' + arg + '"';
  })

  // TODO: figure out meaning of ip/host prefix: [0

  // build up the monitor simple string response
  str = new String(
    util.format(Constants.FORMAT.MONITOR,
      t.s, t.m,
      socket.remoteAddress, socket.remotePort, args.join(' ')));

  // emit the event, listening connections will send replies
  // to clients registered for monitor
  this.emit('monitor', str);
}
function monitor ( req , res ) { var socket = req . conn . socket , args = [ req . cmd ] . concat ( req . args ) , t = systime ( ) , str ; // quote command and args args = args . map ( function ( arg ) { return '"' + arg + '"' ; } ) // TODO: figure out meaning of ip/host prefix: [0 // build up the monitor simple string response str = new String ( util . format ( Constants . FORMAT . MONITOR , t . s , t . m , socket . remoteAddress , socket . remotePort , args . join ( ' ' ) ) ) ; // emit the event, listening connections will send replies // to clients registered for monitor this . emit ( 'monitor' , str ) ; }
Emit the monitor event string.
Emit the monitor event string .