Пример #1
0
 public string ReceiveSubscriber(string topic)
 {
     try
     {
         if (SubscriberSocket == null)
         {
             SubscriberSocket = NetMQFactory.CreateSubscriberSocket(_publisherUrl, topic);
         }
         //string messageTopicReceived = SubscriberSocket.ReceiveFrameString();
         var result = SubscriberSocket.ReceiveFrameBytesSTR();
         LogWrite.Error("[订阅消息]收到消息:" + result);
         return(result.Substring(topic.Length + 1));
     }
     catch (Exception ex)
     {
         LogWrite.Error(ex);
         return(string.Empty);
     }
 }