c# - How can m2mqtt subscribe two topic -
i'm using m2mqtt message ,but can't individual subscribe 2 topic
i use client.subscribe subscribe 2 topic,and use client_mqttmsgpublishreceived(object sender, mqttmsgpublisheventargs e) message
but 2 topic's message mixed . there meth divide it?
just put if statement message handler branch based on incoming messages topic e.topic
.
you can write functions handle different message types , call these message handler , pass mqttmsgpublisheventargs
object functions.
Comments
Post a Comment