IMessageSink Interface

IMessageSink Interface


Defines the interface for a message sink.

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

type IMessageSink = interface end


Gets the next message sink in the sink chain.

System_CAPS_pubmethodAsyncProcessMessage(IMessage, IMessageSink)

Asynchronously processes the given message.


Synchronously processes the given message.

When a method call is made on the proxy, the remoting infrastructure provides the necessary support for passing the arguments to the actual object across the remoting boundaries, calling the actual object method with the arguments, and returning the results back to the client of the proxy object.

A remote method call is a message that goes from the client end to the server end and possibly back again. As it crosses remoting boundaries on the way, the remote method call passes through a chain of IMessageSink objects. Each sink in the chain receives the message object, performs a specific operation, and delegates to the next sink in the chain. The proxy object contains a reference to the first IMessageSink it needs to use to start off the chain.

For asynchronous calls, at the time of delegation, each sink provides a reply sink (another IMessageSink) that will be called by the next sink when the reply is on its way back.

Different types of sinks perform different operations, depending on the type of message object received. For example, one sink could cause a lock to be taken, another could enforce call security, another could perform flow call control and reliability services, and yet another could transport the call to a different AppDomain, process, or computer. Two or more message sinks in the chain can interact with each other in regard to each specific action.

Notes to Implementers:

It is important to note that code implementing the current interface must provide implementations for both SyncProcessMessage and AsyncProcessMessage, since synchronous calls can be converted to asynchronous calls and vice versa. Both methods must be implemented, even if the sink does not support asynchronous processing.

The following code example shows the implementation of the IMessageSink interface. Note that the sample assumes type definitions and assembly references that must be provided for the sample to compile.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft