IClientChannelSinkProvider Interfaccia

Definizione

Crea i sink di canale del client per il canale client attraverso il quale scorrono i messaggi remoti.

public interface class IClientChannelSinkProvider
public interface IClientChannelSinkProvider
[System.Runtime.InteropServices.ComVisible(true)]
public interface IClientChannelSinkProvider
type IClientChannelSinkProvider = interface
[<System.Runtime.InteropServices.ComVisible(true)>]
type IClientChannelSinkProvider = interface
Public Interface IClientChannelSinkProvider
Derivato
Attributi

Esempio

Nell'esempio di codice seguente viene illustrata un'implementazione di questa interfaccia.

[System::Security::Permissions::PermissionSet(System::Security::
   Permissions::SecurityAction::Demand, Name = "FullTrust")]
public ref class ClientSinkProvider: public IClientChannelSinkProvider
{
private:

   // The next provider in the chain.
   IClientChannelSinkProvider^ nextProvider;

public:
   property IClientChannelSinkProvider^ Next 
   {
      virtual IClientChannelSinkProvider^ get()
      {
         return (nextProvider);
      }

      virtual void set( IClientChannelSinkProvider^ value )
      {
         nextProvider = value;
      }
   }

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

   // This constructor is required in order to use the provider in file-based configuration.
   // It need not do anything unless you want to use the information in the parameters.
   ClientSinkProvider( IDictionary^ /*properties*/, ICollection^ /*providerData*/ ){}
};
public class ClientSinkProvider : IClientChannelSinkProvider
{

    // The next provider in the chain.
    private IClientChannelSinkProvider nextProvider;

    public IClientChannelSinkProvider Next
    {
        get
        {
            return(nextProvider);
        }
        set
        {
            nextProvider = value;
        }
    }

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

    // This constructor is required in order to use the provider in file-based configuration.
    // It need not do anything unless you want to use the information in the parameters.
    public ClientSinkProvider (IDictionary properties, ICollection providerData) {}
}

Vedere la documentazione dell'interfaccia IClientChannelSink per un esempio dell'implementazione del sink client corrispondente.

Commenti

I sink di canale sono connessi a un canale client tramite implementazioni dell'interfaccia IClientChannelSinkProvider . Tutti i canali client remoti forniscono costruttori che accettano come IClientChannelSinkProvider parametro.

I provider di sink di canale vengono archiviati in una catena e l'utente è responsabile della concatenazione di tutti i provider di sink di canale prima di passare quello esterno al costruttore del canale. IClientChannelSinkProvider fornisce una proprietà denominata Next per questo scopo.

Quando vengono specificati più provider di sink di canale in un file di configurazione, l'infrastruttura di comunicazione remota li concatena insieme nell'ordine in cui vengono trovati nel file di configurazione. I provider del sink di canale verranno creati quando il canale viene creato durante la RemotingConfiguration.Configure chiamata.

Proprietà

Next

Ottiene o imposta il provider di sink successivo nella catena dei provider di sink di canale.

Metodi

CreateSink(IChannelSender, String, Object)

Crea una catena di sink.

Si applica a