예제 #1
0
 internal bool SendPublisherInformaction(PublisherInformaction publisher)
 {
     try
     {
         if (!IsConnected)
         {
             return(false);
         }
         var message = SendObjectToJsonStreamWithResponse(authRouteCode, publisher);
         SocketResult <string> result;
         if (message != null && message.TryReadFromJsonStream(out result))
         {
             if (result != null && result.Code != "200")
             {
                 return(false);
             }
         }
         else if (message == null)
         {
             return(false);
         }
         return(true);
     }
     catch
     {
         return(false);
     }
 }
예제 #2
0
        private void ReConnectedHandler(object sender, EventArgs e)
        {
            MessageQueueConfigurationSection config = MessageQueueConfigurationSection.GetConfig();

            var authToken = new PublisherInformaction()
            {
                IsWebSite   = IsWebSite,
                MQMToken    = config.MQMPassword,
                PublisherId = PublisherId,
                WebSiteHost = config.WebSiteHost
            };

            if (socketClient.SendPublisherInformaction(authToken))
            {
                RetryAllSubscribes?.Invoke(this, new EventArgs());
                RetryFailed();
            }
        }