title: mqtt.js | client.connected returns false though client seems to be connected
body: <p>while playing around with mqtt.js of node.js i figured out that the value of client.connected seem to be wrong or i misunderstand something. <br/>
  I did this tutorial <a href="http://thejackalofjavascript.com/getting-started-mqtt/" rel="nofollow noreferrer">http://thejackalofjavascript.com/getting-started-mqtt/</a> and everything works fine. <br/><br>
  I tried to get more into mqtt, so i looked up on <a href="https://www.npmjs.com/package/mqtt#mqttclientconnected" rel="nofollow noreferrer">https://www.npmjs.com/package/mqtt#mqttclientconnected</a> , Description of client.connected:</p>
  
  <blockquote>
    <p>Boolean : set to true if the client is connected. false otherwise.</p>
  </blockquote>
  
  <p><br/></p>
  
  <p>In order to look if it works, i modified the sourcecode for the firstline just like this</p>
  
  <pre><code>var mqtt = require('mqtt')
  
  client = mqtt.connect('mqtt://localhost');
  
    if (client.connected == true) {
          console.log("Connection successful.")
      }
      else{
          console.log("Something went wrong.")
      }
  
  client.subscribe('presence');
  
  console.log('Client publishing.. ');
  client.publish('presence', 'Client 1 is alive.. Test Ping! ' + Date());
  
  client.end();
  </code></pre>
  
  <p>I just added the if-clause. When executing the script, I always receive the message, that something went wrong, ergo: connected --> false. <br/>
  But why?</p>