This documentation is archived and is not being maintained.

HttpChannel::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, 
	[OutAttribute] String^% objectURI
) sealed

Parameters

url
Type: System::String
The URL to which the new sink will deliver messages. Can be nullptr.
remoteChannelData
Type: System::Object
The channel data object of the remote host to which the new sink will deliver messages. Can be nullptr.
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 nullptr, remoteChannelData is used as a target for the sink. Either the url or remoteChannelData parameters can be nullptr, but not both.

The following code example shows how to use the CreateMessageSink method. 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( L"http://localhost:9090/RemoteObject.rem", nullptr,  objectUri );
Console::WriteLine( L"The URI of the message sink is {0}.", objectUri );
if ( messageSink != nullptr )
{
   Console::WriteLine( L"The type of the message sink is {0}.", messageSink->GetType() );
}


.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.
Show: