예제 #1
0
 /* ============================================================================== Send */
 public virtual void Send(ClusterMessage message)
 {
     try
     {
         message.SenderInfo = m_clusterMemberInfo;
         Stream messageStream = m_formatter.Serialize(message);
         InternalSend(messageStream);
     }
     catch (Exception e) //logged
     {
         Logger.WriteException(e);
         OnSendException(message, e);
     }
 }
예제 #2
0
 /* ============================================================================== Send */
 public virtual void Send(ClusterMessage message)
 {
     try
     {
         message.SenderInfo = m_clusterMemberInfo;
         message.SenderInfo.ClusterMemberID = this.ReceiverName;
         Stream messageStream = m_formatter.Serialize(message);
         InternalSend(messageStream, message is DebugMessage);
     }
     catch (Exception e) //logged
     {
         Logger.WriteException(e);
         OnSendException(message, e);
     }
 }
예제 #3
0
 /* ============================================================================== Send */
 public virtual void Send(ClusterMessage message)
 {
     try
     {
         message.SenderInfo = m_clusterMemberInfo;
         message.SenderInfo.ClusterMemberID = this.ReceiverName;
         Stream messageStream = m_formatter.Serialize(message);
         SnTrace.Messaging.Write("Sending a '{0}' message", message.GetType().FullName);
         InternalSend(messageStream, message is DebugMessage);
     }
     catch (Exception e) // logged
     {
         SnLog.WriteException(e);
         SnTrace.Messaging.WriteError("Sending a '{0}' message. Exception: {1}", message.GetType().FullName, e);
         OnSendException(message, e);
     }
 }
예제 #4
0
        /* ============================================================================== Send */
        public virtual async Task SendAsync(ClusterMessage message, CancellationToken cancellationToken)
        {
            try
            {
                message.SenderInfo = m_clusterMemberInfo;
                message.SenderInfo.ClusterMemberID = ReceiverName;

                Stream messageStream = m_formatter.Serialize(message);
                SnTrace.Messaging.Write("Sending a '{0}' message", message.GetType().FullName);

                await InternalSendAsync(messageStream, message is DebugMessage, cancellationToken).ConfigureAwait(false);
            }
            catch (Exception e) // logged
            {
                SnLog.WriteException(e);
                SnTrace.Messaging.WriteError("Sending a '{0}' message. Exception: {1}", message.GetType().FullName, e);
                OnSendException(message, e);
            }
        }