System.Runtime.Remoting.Messaging.IMessageSink Interface

Assembly: Mscorlib.dll
Namespace: System.Runtime.Remoting.Messaging
Summary
Defines the interface for a message sink.
C# Syntax:
public interface IMessageSink
Remarks
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 implementors: It is important to note that code implementing the current interface must provide implementations for both IMessageSink.SyncProcessMessage and IMessageSink.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.
See also:
System.Runtime.Remoting.Messaging Namespace

System.Runtime.Remoting.Messaging.IMessageSink Member List:

Public Properties
NextSink Read-only

Gets the next message sink in the sink chain.
Public Methods
AsyncProcessMessage Asynchronously processes the given message.
SyncProcessMessage Synchronously processes the given message.

System.Runtime.Remoting.Messaging.IMessageSink Member Details

Property: NextSink (read-only)
Summary
Gets the next message sink in the sink chain.
C# Syntax:
IMessageSink NextSink {get;}

Return to top


Method: AsyncProcessMessage(
   IMessage msg,
   IMessageSink replySink
)
Summary
Asynchronously processes the given message.
C# Syntax:
IMessageCtrl AsyncProcessMessage(
   IMessage msg,
   IMessageSink replySink
);
Parameters:

msg

The message to process.

replySink

The reply sink for the reply message.

Return Value:
Returns an IMessageCtrl interface that provides a way to control asynchronous messages after they have been dispatched.
Remarks
This method is invoked on the message sink by the remoting infrastructure or by a previous sink for asynchronous messages.

Return to top


Method: SyncProcessMessage(
   IMessage msg
)
Summary
Synchronously processes the given message.
C# Syntax:
IMessage SyncProcessMessage(
   IMessage msg
);
Parameters:

msg

The message to process.

Return Value:
A reply message in response to the request.
Remarks
The IMessageSink.SyncProcessMessage method is invoked on the message sink by the remoting infrastructure or by a previous sink for synchronous messages.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.