Share via


IClientChannelSinkProvider Interface

Definição

Cria os coletores de canal do cliente para o canal do cliente por meio do qual as mensagens de comunicação remota fluem.

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
Derivado
Atributos

Exemplos

O exemplo de código a seguir ilustra uma implementação dessa interface.

[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) {}
}

Consulte a documentação da IClientChannelSink interface para obter um exemplo da implementação do coletor de cliente correspondente.

Comentários

Os coletores de canal são conectados a um canal cliente por meio de implementações da IClientChannelSinkProvider interface. Todos os canais de cliente de comunicação remota fornecem construtores que tomam um IClientChannelSinkProvider como parâmetro.

Os provedores de coletor de canal são armazenados em uma cadeia e o usuário é responsável por encadear todos os provedores de coletores de canal antes de passar o externo para o construtor do canal. IClientChannelSinkProvider fornece uma propriedade chamada Next para essa finalidade.

Quando vários provedores de coletor de canal forem especificados em um arquivo de configuração, a infraestrutura de comunicação remota os encadeará na ordem em que forem encontrados no arquivo de configuração. Os provedores de coletor de canal serão criados quando o canal for criado durante a RemotingConfiguration.Configure chamada.

Propriedades

Next

Obtém ou define o próximo provedor de coletor na cadeia de provedores de coletor do canal.

Métodos

CreateSink(IChannelSender, String, Object)

Cria uma cadeia de coletores.

Aplica-se a