IClientChannelSinkProvider.CreateSink(IChannelSender, String, Object) Método

Definição

Cria uma cadeia de coletores.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

Parâmetros

channel
IChannelSender

Canal para o qual a cadeia de coletores atual está sendo construída.Channel for which the current sink chain is being constructed.

url
String

A URL do objeto ao qual se conectar.The URL of the object to connect to. Esse parâmetro pode ser null se a conexão se basear totalmente nas informações contidas no parâmetro remoteChannelData.This parameter can be null if the connection is based entirely on the information contained in the remoteChannelData parameter.

remoteChannelData
Object

Um objeto de dados de canal que descreve um canal no servidor remoto.A channel data object that describes a channel on the remote server.

Retornos

IClientChannelSink

O primeiro coletor da cadeia de coletores de canal recém-criada ou null, que indica que esse provedor não fornecerá ou não poderá fornecer uma conexão para este ponto de extremidade.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.

Atributos

Exceções

O chamador imediato não tem permissão de infraestrutura.The immediate caller does not have infrastructure permission.

Exemplos

O exemplo de código a seguir ilustra uma implementação desse método.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 ));
}
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
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) );
}

Comentários

Quando o CreateSink método é chamado, ele cria seu próprio coletor de canal, encaminha a CreateSink chamada para o próximo provedor de coletor na cadeia (se houver) e garante que o próximo coletor e o atual estejam vinculados juntos.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.

Aplica-se a