title: Socket.io Multiple messages emitted from one event
body: <p>I've been looking for quite a while for a solution but haven't found anything yet.  </p>
  
  <p>I'm trying to emit a message from a server every time the server sees that a file has changed in a specified directory.  However, instead of only emitting one message, it insists on emitting the same message three times.  I am using chokidar to watch the directory, and inside of the 'change' event I emit the message.<br>
  Server side code:</p>
  
  <pre><code>var   express = require('express')
      , app = express()
      , http = require('http')
      , server = http.Server(app)
      , io =require('socket.io')(server)
      , chokidar = require('chokidar');
  server.listen(1234);
  app.use('/public', express.static( __dirname + '/public'));
  app.get('/', function(request, response){
      var ipAddress = request.socket.remoteAddress;
      console.log("New express connection from: " + ipAddress);
      response.sendfile(__dirname + '/public/index.html'); //Server client
  });
  
  
  
  
   var watcher = chokidar.watch("temp", {ignored: /[\/\\]\./, persistent: true});
  
      watcher.on('change', function(path){
          console.log(path + " has changed.");
          fs.readFile(path,'utf8', function(err, data){
              if(err) {
                  return console.log(err);
              }
              else
              {
                  var json = JSON.parse(data), recPsec, type;
                  recPsec = json.data[0].values[0];
                  type = json.data[0].values[16];
                  var compiled = {
                                                      "recPsec" : recPsec,
                                                      "type"      : type
                                               }
                  var jsonMessage = JSON.stringify(compiled)
                  io.sockets.emit('message', JSON.stringify(jsonMessage));
                  console.log("Sent message");
              }
  
          });
  
      });
  watcher.on('unlink', function(path){
      console.log('File: ', path, ' has been removed');
  });
  
  watcher.on('add', function(path){
      console.log("hi");
      fs.readFile(path,'utf8', function(err, data){
          if(err) {
              return console.log(err);
          }
          else
          {
          var json = JSON.parse(data), recPsec, type;
              recPsec = json.data[0].values[0];
              type = json.data[0].values[16];
              var compiled = {
                                                  "recPsec" : recPsec,
                                                  "type"      : type
                                           }
              var jsonMessage = compiled;
              io.sockets.emit('message', JSON.stringify(jsonMessage));
              console.log("message sent");
          }
          //fs.unlinkSync(path);
      });
  });
  </code></pre>
  
  <p>Client Side:</p>
  
  <pre><code> var socket = io.connect('http://localhost');
          socket.on('message', function(data){
              console.log(data);
              var parsed = JSON.parse(data);
              recPsecNew = parsed.recPsec;
              typeNew = parsed.type;
              analyze(recPsecNew, typeNew);
          });
  </code></pre>
  
  <p>I am using socket.io in conjunction with express 4. 
  Chokidar is found here: <a href="https://github.com/paulmillr/chokidar" rel="nofollow">https://github.com/paulmillr/chokidar</a></p>
  
  <p>Logs from the console if I change the name of a file twice are shown here: <a href="http://s000.tinyupload.com/?file_id=95726281991906625675" rel="nofollow">http://s000.tinyupload.com/?file_id=95726281991906625675</a></p>