HttpClientChannel.CreateMessageSink Method (String, Object, String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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.

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
Available since 1.1
Return to top
Show: