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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -