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 costruita la catena di sink corrente.

url
String

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

remoteChannelData
Object

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

Valori restituiti

Primo sink della catena di sink del canale appena formato o null, che indica che questo provider non fornirà o non può fornire una connessione per questo endpoint.

Attributi

Eccezioni

Il chiamante immediato non dispone dell'autorizzazione dell'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 garantisce che il sink successivo e quello corrente siano collegati tra loro.

Si applica a