Based on the open source Net MQTT Client connection Ali cloud platform of Things

Outline

Earlier we introduced the example of the connection of things Ali cloud platform based on open source MQTT Client Java and Python language used here M2Mqtt Client C # test, combined with a custom message Topic demo up and down the line.

Steps

1, the installation M2Mqtt
_

2、Code sample

using System;
using System.Text;
using uPLibrary.Networking.M2Mqtt;
using uPLibrary.Networking.M2Mqtt.Messages;

namespace MQTTDemo
{
    class Program
    {
        //private MqttClient client;
        static void Main(string[] args)
        {
  

Guess you like

Origin yq.aliyun.com/articles/725268