編輯

共用方式為


IClientChannelSinkProvider.CreateSink(IChannelSender, String, Object) Method

Definition

Creates a sink chain.

public:
 System::Runtime::Remoting::Channels::IClientChannelSink ^ CreateSink(System::Runtime::Remoting::Channels::IChannelSender ^ channel, System::String ^ url, System::Object ^ remoteChannelData);
public System.Runtime.Remoting.Channels.IClientChannelSink CreateSink (System.Runtime.Remoting.Channels.IChannelSender channel, string url, object remoteChannelData);
[System.Security.SecurityCritical]
public System.Runtime.Remoting.Channels.IClientChannelSink CreateSink (System.Runtime.Remoting.Channels.IChannelSender channel, string url, object remoteChannelData);
abstract member CreateSink : System.Runtime.Remoting.Channels.IChannelSender * string * obj -> System.Runtime.Remoting.Channels.IClientChannelSink
[<System.Security.SecurityCritical>]
abstract member CreateSink : System.Runtime.Remoting.Channels.IChannelSender * string * obj -> System.Runtime.Remoting.Channels.IClientChannelSink
Public Function CreateSink (channel As IChannelSender, url As String, remoteChannelData As Object) As IClientChannelSink

Parameters

channel
IChannelSender

Channel for which the current sink chain is being constructed.

url
String

The URL of the object to connect to. This parameter can be null if the connection is based entirely on the information contained in the remoteChannelData parameter.

remoteChannelData
Object

A channel data object that describes a channel on the remote server.

Returns

The first sink of the newly formed channel sink chain, or null, which indicates that this provider will not or cannot provide a connection for this endpoint.

Attributes

Exceptions

The immediate caller does not have infrastructure permission.

Examples

The following code example illustrates an implementation of this method.

virtual IClientChannelSink^ CreateSink( IChannelSender^ channel, String^ url, Object^ remoteChannelData )
{
   Console::WriteLine( "Creating ClientSink for {0}", url );
   
   // Create the next sink in the chain.
   IClientChannelSink^ nextSink = nextProvider->CreateSink( channel, url, remoteChannelData );
   
   // Hook our sink up to it.
   return (gcnew ClientSink( nextSink ));
}
public IClientChannelSink CreateSink (IChannelSender channel, String url, Object remoteChannelData)
{

    Console.WriteLine("Creating ClientSink for {0}", url);

    // Create the next sink in the chain.
    IClientChannelSink nextSink = nextProvider.CreateSink(channel, url, remoteChannelData);

    // Hook our sink up to it.
    return( new ClientSink(nextSink) );
}

Remarks

When the CreateSink method is called, it creates its own channel sink, forwards the CreateSink call to the next sink provider in the chain (if there is one), and ensures that the next sink and the current one are linked together.

Applies to