共用方式為


IClientChannelSink.ProcessMessage 方法

定義

要求來自目前接收的訊息處理。

public:
 void ProcessMessage(System::Runtime::Remoting::Messaging::IMessage ^ msg, System::Runtime::Remoting::Channels::ITransportHeaders ^ requestHeaders, System::IO::Stream ^ requestStream, [Runtime::InteropServices::Out] System::Runtime::Remoting::Channels::ITransportHeaders ^ % responseHeaders, [Runtime::InteropServices::Out] System::IO::Stream ^ % responseStream);
public void ProcessMessage (System.Runtime.Remoting.Messaging.IMessage msg, System.Runtime.Remoting.Channels.ITransportHeaders requestHeaders, System.IO.Stream requestStream, out System.Runtime.Remoting.Channels.ITransportHeaders responseHeaders, out System.IO.Stream responseStream);
[System.Security.SecurityCritical]
public void ProcessMessage (System.Runtime.Remoting.Messaging.IMessage msg, System.Runtime.Remoting.Channels.ITransportHeaders requestHeaders, System.IO.Stream requestStream, out System.Runtime.Remoting.Channels.ITransportHeaders responseHeaders, out System.IO.Stream responseStream);
abstract member ProcessMessage : System.Runtime.Remoting.Messaging.IMessage * System.Runtime.Remoting.Channels.ITransportHeaders * System.IO.Stream * ITransportHeaders * Stream -> unit
[<System.Security.SecurityCritical>]
abstract member ProcessMessage : System.Runtime.Remoting.Messaging.IMessage * System.Runtime.Remoting.Channels.ITransportHeaders * System.IO.Stream * ITransportHeaders * Stream -> unit
Public Sub ProcessMessage (msg As IMessage, requestHeaders As ITransportHeaders, requestStream As Stream, ByRef responseHeaders As ITransportHeaders, ByRef responseStream As Stream)

參數

msg
IMessage

要處理的訊息。

requestHeaders
ITransportHeaders

要加入至伺服器外送訊息標題的標頭。

requestStream
Stream

流向傳輸接收的資料流。

responseHeaders
ITransportHeaders

當這個方法傳回時,會包含保存伺服器所傳回之標頭的 ITransportHeaders 介面。 這個參數會以未初始化的狀態傳遞。

responseStream
Stream

當這個方法傳回時,包含返回自傳輸接收的 Stream。 這個參數會以未初始化的狀態傳遞。

屬性

例外狀況

立即呼叫端沒有基礎結構使用權限。

範例

下列程式代碼範例說明這個方法的實作。

virtual void ProcessMessage( IMessage^ message, ITransportHeaders^ requestHeaders, Stream^ requestStream, [Out]ITransportHeaders^% responseHeaders, [Out]Stream^% responseStream )
{
   // Print the request message properties.
   Console::WriteLine( "---- Message from the client ----" );
   IDictionary^ dictionary = message->Properties;
   IEnumerator^ myEnum = dictionary->Keys->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      Object^ key = safe_cast<Object^>(myEnum->Current);
      Console::WriteLine( "{0} = {1}", key, dictionary[ key ] );
   }

   Console::WriteLine( "---------------------------------" );

   // Hand off to the next sink in the chain.
   nextSink->ProcessMessage( message, requestHeaders, requestStream, responseHeaders, responseStream );
}
public void ProcessMessage (IMessage message,
                            ITransportHeaders requestHeaders,
                            Stream requestStream,
                            out ITransportHeaders responseHeaders,
                            out Stream responseStream)
{
    // Print the request message properties.
    Console.WriteLine("---- Message from the client ----");
    IDictionary dictionary = message.Properties;
    foreach (Object key in dictionary.Keys)
    {
        Console.WriteLine("{0} = {1}", key, dictionary[key]);
    }
    Console.WriteLine("---------------------------------");

    // Hand off to the next sink in the chain.
    nextSink.ProcessMessage(message, requestHeaders, requestStream, out responseHeaders, out responseStream);
}

適用於

另請參閱