當前位置: 首頁>>代碼示例>>C#>>正文


C# Message.ReleaseBodyAndHeaderBuffers方法代碼示例

本文整理匯總了C#中Orleans.Runtime.Message.ReleaseBodyAndHeaderBuffers方法的典型用法代碼示例。如果您正苦於以下問題:C# Message.ReleaseBodyAndHeaderBuffers方法的具體用法?C# Message.ReleaseBodyAndHeaderBuffers怎麽用?C# Message.ReleaseBodyAndHeaderBuffers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Orleans.Runtime.Message的用法示例。


在下文中一共展示了Message.ReleaseBodyAndHeaderBuffers方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SendRejectionMessage

 internal void SendRejectionMessage(Message rejection)
 {
     if (rejection.Result == Message.ResponseTypes.Rejection)
     {
         Transport.SendMessage(rejection);
         rejection.ReleaseBodyAndHeaderBuffers();
     }
     else
     {
         throw new InvalidOperationException(
             "Attempt to invoke Dispatcher.SendRejectionMessage() for a message that isn't a rejection.");
     }
 }
開發者ID:andrewalex,項目名稱:orleans,代碼行數:13,代碼來源:Dispatcher.cs

示例2: ProcessMessageAfterSend

 protected override void ProcessMessageAfterSend(Message msg, bool sendError, string sendErrorStr)
 {
     msg.ReleaseBodyAndHeaderBuffers();
     if (sendError)
     {
         // We can't recycle the current message, because that might wind up with it getting delivered out of order, so we have to reject it
         FailMessage(msg, sendErrorStr);
     }
 }
開發者ID:Rejendo,項目名稱:orleans,代碼行數:9,代碼來源:GatewayConnection.cs

示例3: FailMessage

 protected override void FailMessage(Message msg, string reason)
 {
     msg.ReleaseBodyAndHeaderBuffers();
     MessagingStatisticsGroup.OnFailedSentMessage(msg);
     if (MsgCenter.Running && msg.Direction == Message.Directions.Request)
     {
         if (Log.IsVerbose) Log.Verbose(ErrorCode.ProxyClient_RejectingMsg, "Rejecting message: {0}. Reason = {1}", msg, reason);
         MessagingStatisticsGroup.OnRejectedMessage(msg);
         Message error = msg.CreateRejectionResponse(Message.RejectionTypes.Unrecoverable, reason);
         MsgCenter.QueueIncomingMessage(error);
     }
     else
     {
         Log.Warn(ErrorCode.ProxyClient_DroppingMsg, "Dropping message: {0}. Reason = {1}", msg, reason);
         MessagingStatisticsGroup.OnDroppedSentMessage(msg);
     }
 }
開發者ID:Rejendo,項目名稱:orleans,代碼行數:17,代碼來源:GatewayConnection.cs

示例4: OnMessageSerializationFailure

        protected override void OnMessageSerializationFailure(Message msg, Exception exc)
        {
            // we only get here if we failed to serialise the msg (or any other catastrophic failure).
            // Request msg fails to serialise on the sending silo, so we just enqueue a rejection msg.
            Log.Warn(ErrorCode.ProxyClient_SerializationError, String.Format("Unexpected error serializing message to gateway {0}.", Address), exc);
            FailMessage(msg, String.Format("Unexpected error serializing message to gateway {0}. {1}", Address, exc));
            if (msg.Direction == Message.Directions.Request || msg.Direction == Message.Directions.OneWay)
            {
                return;
            }

            // Response msg fails to serialize on the responding silo, so we try to send an error response back.
            // if we failed sending an original response, turn the response body into an error and reply with it.
            msg.Result = Message.ResponseTypes.Error;
            msg.BodyObject = Response.ExceptionResponse(exc);
            try
            {
                MsgCenter.SendMessage(msg);
            }
            catch (Exception ex)
            {
                // If we still can't serialize, drop the message on the floor
                Log.Warn(ErrorCode.ProxyClient_DroppingMsg, "Unable to serialize message - DROPPING " + msg, ex);
                msg.ReleaseBodyAndHeaderBuffers();
            }
        }
開發者ID:Rejendo,項目名稱:orleans,代碼行數:26,代碼來源:GatewayConnection.cs


注:本文中的Orleans.Runtime.Message.ReleaseBodyAndHeaderBuffers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。