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);
}

适用于

另请参阅