Esempio n. 1
0
        public LogSubscriber()
        {
            param          = new MQTTClientParam();
            param.clientID = Guid.NewGuid().ToString();

            param.ip       = Config.envConfigInfo.confLogServiceInfo.IP;
            param.port     = Config.envConfigInfo.confLogServiceInfo.Port;
            param.userName = Config.envConfigInfo.confLogServiceInfo.UserName;
            param.password = MD5Util.MD5Decrypt(Config.envConfigInfo.confLogServiceInfo.Password);

            filePath  = Config.envConfigInfo.confLogServiceInfo.filePath;
            tableName = Config.envConfigInfo.confLogServiceInfo.tableName;
            newsTopic = Config.envConfigInfo.confLogServiceInfo.NewsTopic;
        }
Esempio n. 2
0
 /// <summary>
 /// 初始化MQTT客户端
 /// </summary>
 /// <param name="param">连接目标服务器参数</param>
 /// <param name="actionReciveData">接受主题数据的方法</param>
 public MQTTClient(MQTTClientParam param, Action <MQTTTopicData> actionReciveData)
 {
     this.param            = param;
     this.actionReciveData = actionReciveData;
 }