Compartilhar via


IClientChannelSink.ProcessMessage Método

Definição

Solicita o processamento de mensagens do coletor atual.

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)

Parâmetros

msg
IMessage

A mensagem a ser processada.

requestHeaders
ITransportHeaders

Os cabeçalhos a serem adicionados à mensagem de saída que está sendo encaminhada para o servidor.

requestStream
Stream

O fluxo direcionado ao coletor de transporte.

responseHeaders
ITransportHeaders

Quando este método é retornado, ele contém uma interface ITransportHeaders que contém os cabeçalhos retornados pelo servidor. Este parâmetro é passado não inicializado.

responseStream
Stream

Quando este método é retornado, contém um Stream que está voltando do coletor de transporte. Este parâmetro é passado não inicializado.

Atributos

Exceções

O chamador imediato não tem permissão de infraestrutura.

Exemplos

O exemplo de código a seguir ilustra uma implementação desse método.

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

Aplica-se a

Confira também