title: Socket.io Client.emit not working inside if loop
body: <p>I am starting with Node.js. I want to emit some data to client at the starting of every hour.</p>
  
  <pre><code>var d = new Date();
  var a=d.getDate();
  var h = d.getHours();
  if(h&lt;10){
      h="0"+h;
  }
  if(d&lt;10){
      d="0"+d;
  }
  time=a+""+h;
  
  //Message from redis
  rClient.on("message", function(channel, message) {
      var vals=message.split("#");
  
      if(vals[1]!=time){
          var msg="sending reset";
          console.log(msg);
          client.emit('hreset',msg);
          time=vals[1];
      }
  }
  </code></pre>
  
  <p>inside client </p>
  
  <pre><code>socket.on('hreset', function(val) {
      alert(val);
      reset();
      alert("reseting Data completed");
  });
  </code></pre>
  
  <p>But it's not triggering the code in client. If I change the condition from <code>!=</code> to <code>==</code> it's working fine and triggering every second. But not working in case of <code>!=</code>. It's going inside the if condition but not emitting the <code>hreset</code>.</p>