title: Problems with Mosquitto and last will (testament)
body: <p>I'm using Mosquitto and the Python implementation of Paho to try to communicate a couple of programmes. I'm getting some troubles when I use the last will function. My code is this:</p>
  
  <p>Suscriber:</p>
  
  <pre><code>import paho.mqtt.client as mqtt
  def on_message(client, userdata, msg):
      print 'Received: ' + msg.payload
  
  client = mqtt.Client()
  client.on_message = on_message
  
  client.connect('localhost', 1883)
  client.subscribe('hello/#')
  
  client.loop_forever()
  </code></pre>
  
  <p>Publisher:</p>
  
  <pre><code>import paho.mqtt.client as mqtt
  
  client = mqtt.Client()
  
  client.will_set('hello/will', 'Last will', 0, False)
  client.connect('localhost', 1883)
  
  client.publish('hello/world', 'Regular msg', 0, False)
  client.disconnect()
  </code></pre>
  
  <p>The output:</p>
  
  <pre><code>Received: Last will
  </code></pre>
  
  <p>I should receive only the regular message because I use <code>client.disconnect()</code> to close the connection. If I comment the <code>will_set</code> line, I get the regular message. I also tried publishing both on the same topic and it doesn't work.</p>