This documentation is archived and is not being maintained.

IClientChannelSink.ProcessMessage Method

Requests message processing from the current sink.

Namespace: System.Runtime.Remoting.Channels
Assembly: mscorlib (in mscorlib.dll)

void ProcessMessage (
	IMessage msg,
	ITransportHeaders requestHeaders,
	Stream requestStream,
	out ITransportHeaders responseHeaders,
	out Stream responseStream
)
void ProcessMessage (
	IMessage msg, 
	ITransportHeaders requestHeaders, 
	Stream requestStream, 
	/** @attribute OutAttribute() */ /** @ref */ ITransportHeaders responseHeaders, 
	/** @attribute OutAttribute() */ /** @ref */ Stream responseStream
)
Not applicable.

Parameters

msg

The message to process.

requestHeaders

The headers to add to the outgoing message heading to the server.

requestStream

The stream headed to the transport sink.

responseHeaders

When this method returns, contains a ITransportHeaders interface that holds the headers that the server returned. This parameter is passed uninitialized.

responseStream

When this method returns, contains a Stream coming back from the transport sink. This parameter is passed uninitialized.

Exception typeCondition

SecurityException

The immediate caller does not have infrastructure permission.

The following code example illustrates an implementation of this method.

[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
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);
} 

public void ProcessMessage(IMessage message, ITransportHeaders requestHeaders, 
    Stream requestStream, /** @ref */ ITransportHeaders responseHeaders,
    /** @ref */ Stream responseStream)
{
    // Print the request message properties.
    Console.WriteLine("---- Message from the client ----");
    IDictionary dictionary = message.get_Properties();
    Object key = null;
    IEnumerator objEnum = dictionary.get_Keys().GetEnumerator();
    while (objEnum.MoveNext()) {
        key = objEnum.get_Current();
        Console.WriteLine("{0} = {1}", key, dictionary.get_Item(key));
    }
    Console.WriteLine("---------------------------------");
    // Hand off to the next sink in the chain.
    nextSink.ProcessMessage(message, requestHeaders, requestStream,
        responseHeaders, responseStream);
} //ProcessMessage

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Show: