IClientChannelSinkProvider.CreateSink(IChannelSender, String, Object) Metodo

Definizione

Crea una catena di sink.

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

Parametri

channel
IChannelSender

Canale per il quale viene generata la catena di sink corrente.

url
String

URL dell'oggetto a cui effettuare la connessione. Questo parametro può essere null se la connessione si basa completamente sulle informazioni contenute nel parametro remoteChannelData.

remoteChannelData
Object

Oggetto dati del canale che descrive un canale sul server remoto.

Restituisce

Primo sink della catena di sink di canale appena costituita oppure null per indicare che questo provider non fornirà o non è in grado di fornire una connessione per l'endpoint.

Attributi

Eccezioni

Il chiamante immediato non dispone dell'autorizzazione di infrastruttura.

Esempio

Nell'esempio di codice seguente viene illustrata un'implementazione di questo metodo.

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

Commenti

Quando il CreateSink metodo viene chiamato, crea il proprio sink del canale, inoltra la CreateSink chiamata al provider sink successivo nella catena (se presente) e assicura che il sink successivo e quello corrente siano collegati tra loro.

Si applica a