SdlChannelSink.ProcessMessage Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Requests message processing from the current sink.
public:
virtual System::Runtime::Remoting::Channels::ServerProcessing ProcessMessage(System::Runtime::Remoting::Channels::IServerChannelSinkStack ^ sinkStack, System::Runtime::Remoting::Messaging::IMessage ^ requestMsg, System::Runtime::Remoting::Channels::ITransportHeaders ^ requestHeaders, System::IO::Stream ^ requestStream, [Runtime::InteropServices::Out] System::Runtime::Remoting::Messaging::IMessage ^ % responseMsg, [Runtime::InteropServices::Out] System::Runtime::Remoting::Channels::ITransportHeaders ^ % responseHeaders, [Runtime::InteropServices::Out] System::IO::Stream ^ % responseStream);
public System.Runtime.Remoting.Channels.ServerProcessing ProcessMessage (System.Runtime.Remoting.Channels.IServerChannelSinkStack sinkStack, System.Runtime.Remoting.Messaging.IMessage requestMsg, System.Runtime.Remoting.Channels.ITransportHeaders requestHeaders, System.IO.Stream requestStream, out System.Runtime.Remoting.Messaging.IMessage responseMsg, out System.Runtime.Remoting.Channels.ITransportHeaders responseHeaders, out System.IO.Stream responseStream);
abstract member ProcessMessage : System.Runtime.Remoting.Channels.IServerChannelSinkStack * System.Runtime.Remoting.Messaging.IMessage * System.Runtime.Remoting.Channels.ITransportHeaders * System.IO.Stream * IMessage * ITransportHeaders * Stream -> System.Runtime.Remoting.Channels.ServerProcessing
override this.ProcessMessage : System.Runtime.Remoting.Channels.IServerChannelSinkStack * System.Runtime.Remoting.Messaging.IMessage * System.Runtime.Remoting.Channels.ITransportHeaders * System.IO.Stream * IMessage * ITransportHeaders * Stream -> System.Runtime.Remoting.Channels.ServerProcessing
Public Function ProcessMessage (sinkStack As IServerChannelSinkStack, requestMsg As IMessage, requestHeaders As ITransportHeaders, requestStream As Stream, ByRef responseMsg As IMessage, ByRef responseHeaders As ITransportHeaders, ByRef responseStream As Stream) As ServerProcessing
- sinkStack
- IServerChannelSinkStack
A stack of channel sinks that called the current sink.
- requestMsg
- IMessage
The message that contains the request.
- requestHeaders
- ITransportHeaders
The headers that are retrieved from the incoming message from the client.
- requestStream
- Stream
The stream that needs to be processed and passed on to the deserialization sink.
- responseMsg
- IMessage
When this method returns, contains a IMessage that holds the response message. This parameter is passed uninitialized.
- responseHeaders
- ITransportHeaders
When this method returns, contains a ITransportHeaders that holds the headers to add to return message heading to the client. This parameter is passed uninitialized.
- responseStream
- Stream
When this method returns, contains a Stream that is heading to the transport sink. This parameter is passed uninitialized.
A ServerProcessing status value that provides information about how the message was processed.
The proxy's job is to convert a method call that is invoked on it into a message object. The Message object, which implements the IMessage interface, is passed from the client end to the server end by invoking ProcessMessage on message sink objects. Message sinks are chained together, which means that every message sink is responsible for calling ProcessMessage on the next message sink after it has performed its work. For instance, a synchronization-related message sink might cause a lock to be acquired or released and delegated to the downstream message sink.
When the formatter channel sink gets a message that needs to be sent over the channel, it calls SyncProcessMessage, passing the message as a parameter. The formatter sink then creates the transport header array and calls GetRequestStream on the formatter sink. This call is forwarded down the sink chain, and any sink can create a request stream that is passed back to the formatter sink. After this call returns, the message is serialized, ProcessMessage is called on the first chain in the sink chain, and the message is passed to the channel sinks.
After the channel sinks get the message, they can write data to the stream, add headers to the header array, and add themselves to the sink stack before forwarding the call to the next sink. When the call reaches the transport sink at the end of the chain, the transport sink sends the headers and serialized message over the channel to the server, where the process is reversed.
When the message reaches the server side, the transport sink retrieves the headers and serialized message from the stream and forwards these through the sink chain until they reach the formatter sink. The formatter sink then deserializes the message and forwards it to remoting, where the message is turned into a method call and the server object is called.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: