title: duplicate message received on redis sub
body: <p>I am using express 3x, node.js and redis. when i as publishing message then 1 have receive this message 2-3 times in subscribe. (e.g. when i am refreshing my browser, message receive increase by 1 each time) . 
  below is my code.</p>
  
  <hr>
  
  <p>server side :
  ~~~~~~~~~~</p>
  
  <pre><code>var express = require('express'),
      http = require('http')
  
  var redis = require('redis');
  var redisCli = redis.createClient();
  var redisPub = redis.createClient();
  var redisSub = redis.createClient();
  
  redisCli.on("error", function (err) {
      console.error("\r\n Error generated from redis client ", err);
  });
  redisPub.on("error", function (err) {
      console.error("\r\n Error generated from redisPub ", err);
  });
  redisSub.on("error", function (err) {
      console.error("\r\n Error generated from redisSub ", err);
  });
  
  var server = http.createServer(app)
    , io = require('socket.io').listen(server);
  
  server.listen(process.env.PORT);
  
  app.configure(function () {
      app.set('views', __dirname + '/views');
      app.set('view engine', 'jade');
      app.set('view options', { layout: false });
  
      app.use(express.favicon(__dirname + '/favicon.ico', { maxAge: 2592000000 }));
      app.use(express.bodyParser());
      app.use(express.cookieParser());
      app.use(express.session({ secret: "myKey", store: new RedisStore({ maxAge: 86400000, client: redisCli }), cookie: { maxAge: 86400000} }));
      app.use(express.methodOverride());
      app.use(app.router);
      app.use(express.static(__dirname + '/static'));
  });
  
  io.configure(function () {
      io.enable('browser client minification');  // send minified client
      io.enable('browser client etag');          // apply etag caching logic based on version number
      io.enable('browser client gzip');          // gzip the file
  
      io.set('log level', 1);
      io.set("flash policy server", false);
      io.set("transports", ["jsonp-polling", "xhr-polling"]);
  });
  
  io.sockets.on('connection', function (client) {
      console.log("server - redisSub.subscribe from io.on.connection");
      redisSub.unsubscribe();
      redisSub.subscribe("announcement");
  
      redisSub.on("message", function (channel, message) {
          io.sockets.emit('announcement', message);
      });
  
      client.on('disconnect', function () {
          redisSub.unsubscribe("announcement");
          redisSub.quit();
      });
  
  });
  
  app.post('/PublishMessage', function (req, res) {
      redisPub.publish("announcement", req.body.users);
  
      res.setHeader('Cache-Control', 'max-age=0, must-revalidate, no-cache, no-store');
      res.setHeader('Connection', 'keep-alive');
      res.contentType('application/json');
      res.setHeader('Expires', new Date().addYears(-10));
      res.json({ result: 'ok' });
  });
  </code></pre>
  
  <hr>
  
  <p>Client side
  ~~~~~~~~~</p>
  
  <pre><code>    this.socket = io.connect('http://XXX.XXX.X.XXX/', { transports: ['jsonp-polling', 'xhr-polling'] });
      this.socket.on('connect', function () {
          alert("client - Socket client connect");
      });
      this.socket.on('announcement', function (msg) {
          alert("clientside - announcement ");
          var nUsers = parseInt($('#Summary&gt;article&gt;p:last').text(), 10) + parseInt(msg, 10);
          $('#Summary&gt;article&gt;p:last').text(nUsers);
      });
  </code></pre>
  
  <p>=================================================================
  So, any one guide me for the same !!!
  thank you very much.</p>