IpcChannel.CreateMessageSink Method
Returns a channel message sink that delivers messages to the specified URL or channel data object.
Assembly: System.Runtime.Remoting (in System.Runtime.Remoting.dll)
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure, Infrastructure = true)] public IMessageSink CreateMessageSink( string url, Object remoteChannelData, out string objectURI )
Parameters
- url
- Type: System.String
The URL to which the new sink should deliver messages. Can be null.
- remoteChannelData
- Type: System.Object
The channel data object of the remote host to which the new sink should deliver messages. Can be null.
- objectURI
- Type: System.String%
When this method returns, contains a URI of the new channel message sink that delivers messages to the specified URL or channel data object. This parameter is passed uninitialized.
Return Value
Type: System.Runtime.Remoting.Messaging.IMessageSinkA channel message sink that delivers messages to the specified URL or channel data object.
Implements
IChannelSender.CreateMessageSink(String, Object, String)The CreateMessageSink method returns a channel message sink that delivers messages to either the specified URL or channel data object. If the uri parameter is null, remoteChannelData is used as a target for the sink. Either the url or remoteChannelData parameters can be null, but not both.
Channel sinks provide a plug-in point that allows access to the underlying messages flowing through the channel as well as the stream used by the transport mechanism to send messages to a remote object. Channel sinks are linked together in a chain of ChannelSinkProviders and all channel messages flow through this chain of sinks before the message is finally serialized and transported.
The following code example shows how to use the CreateMessageSink method. This code example is part of a larger example provided for the IpcChannel class.
// Create a message sink. string objectUri; System.Runtime.Remoting.Messaging.IMessageSink messageSink = channel.CreateMessageSink( "ipc://localhost:9090/RemoteObject.rem", null, out objectUri); Console.WriteLine("The URI of the message sink is {0}.", objectUri); if (messageSink != null) { Console.WriteLine("The type of the message sink is {0}.", messageSink.GetType().ToString()); }
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.