Langue

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

Définition

Crée une chaîne de récepteurs.

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

Paramètres

channel
IChannelSender

Canal pour lequel la chaîne de récepteur actuelle est construite.

url
String

URL de l’objet à laquelle se connecter. Ce paramètre peut être null si la connexion est entièrement basée sur les informations contenues dans le remoteChannelData paramètre.

remoteChannelData
Object

Objet de données de canal qui décrit un canal sur le serveur distant.

Retours

Premier récepteur de la chaîne de récepteur de canal nouvellement formée, ou null, qui indique que ce fournisseur ne fournira pas ou ne peut pas fournir de connexion pour ce point de terminaison.

Attributs

Exceptions

L’appelant immédiat n’a pas d’autorisation d’infrastructure.

Exemples

L’exemple de code suivant illustre une implémentation de cette méthode.

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) );
}

Remarques

Lorsque la CreateSink méthode est appelée, elle crée son propre récepteur de canal, transfère l’appel CreateSink au fournisseur de récepteur suivant dans la chaîne (s’il en existe un), et garantit que le récepteur suivant et celui actuel sont liés.

S’applique à