Example #1
0
 /// <summary>
 /// 메시지 구독
 /// </summary>
 /// <param name="Sub">구독 정보</param>
 public void Subscribe(MQSubscribe Sub)
 {
     Subscribes.Add(Sub.Topic, Sub);
     if (client != null && client.IsConnected)
     {
         client.Subscribe(new string[] { Sub.Topic }, new byte[] { (byte)Sub.Qos });
     }
 }
Example #2
0
 public MQReceiveArgs(MQSubscribe sub, byte[] Data)
 {
     this.Topic   = sub.Topic;
     this.Datas   = Data;
     this.IsParse = true;
     if (sub.ParseType != null)
     {
         IsParse     = true;
         ParseType   = sub.ParseType;
         ParseObject = Serialize.JsonDeserialize(Encoding.UTF8.GetString(Data), sub.ParseType);
     }
 }