title: how to cleartimeout in node.js
body: <p>Hi We are developing application in node.js , socket.io ,  and redis.</p>
  
  <p>we have this procedure :</p>
  
  <pre><code>exports.processRequest = function (request,result) {
       var self = this;
       var timerknock;
       switch(request._command) {
      case 'some command': // user login with username 
              // some statement 
              timerknock=setTimeout(function() {
                  //some  statemetn
              },20*1000);
          case 'other command ':
              // some statement    
              clearTimeout(timerknock);
        }
  };
  </code></pre>
  
  <p>but when it cancel the timer it is not getting canceled when other command is executed , what should i do to cancel the timer ?</p>