title: Is there a way to verify if a topic as been subscribed to
body: <p>I am trying to make a python program that receive and send messages to my mqtt server from many devices (gateway). What i would like to do is when i receive a message from a device, verify if this device adresse as already been subscribed so i can receive external message to this device and route it to this particular device.</p>
  
  <p>Right now each time i receive data from a device i resubscribe to the topic not knowing if it is already subscribed.</p>
  
  <pre><code>if (time.time() - last_sent_message) &gt;= 0.25:
      message = daemon.memcache_read()
      if message:
          daemon.serial_print(message)
          #daemon.udp_send(message)
          try:
              mqttc.publish("to_" + message[8:17], message)
              mqttc.subscribe("from_" + message[8:17], 0)
          except:
              pass
          last_sent_message = time.time()
  </code></pre>