Export (0) Print
Expand All

HttpClientChannel.CreateMessageSink Method

Returns a channel message sink that delivers messages to the specified URL or channel data object.

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

[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure, 
	Infrastructure = true)]
public virtual IMessageSink CreateMessageSink(
	string url,
	Object remoteChannelData,
	out string objectURI
)

Parameters

url
Type: System.String

The URL to which the new sink will deliver messages. Can be null.

remoteChannelData
Type: System.Object

The channel data object of the remote host to which the new sink will 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.IMessageSink
A 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 the 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.

The following code example shows how to use the CreateMessageSink property. This code example is part of a larger example provided for the HttpClientChannel class.

// Create a message sink. 
string objectUri;
System.Runtime.Remoting.Messaging.IMessageSink messageSink = 
    clientChannel.CreateMessageSink(
    "http://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());
}

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft