IClientChannelSinkProvider Interfaz

Definición

Crea receptores de canal de cliente para el canal de cliente a través del que circulan los mensajes de comunicación remota.

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

Ejemplos

En el ejemplo de código siguiente se muestra una implementación de esta interfaz.

[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 la documentación de la IClientChannelSink interfaz para obtener un ejemplo de la implementación del receptor de cliente correspondiente.

Comentarios

Los receptores de canal se conectan a un canal de cliente a través de implementaciones de la IClientChannelSinkProvider interfaz . Todos los canales de cliente de comunicación remota proporcionan constructores que toman como IClientChannelSinkProvider parámetro .

Los proveedores de receptores de canal se almacenan en una cadena y el usuario es responsable de encadenar todos los proveedores receptores de canal juntos antes de pasar el externo al constructor del canal. IClientChannelSinkProvider proporciona una propiedad denominada Next para este propósito.

Cuando se especifican varios proveedores de receptores de canal en un archivo de configuración, la infraestructura de comunicación remota los encadenará en el orden en que se encuentran en el archivo de configuración. Los proveedores de receptores del canal se crearán cuando se cree el canal durante la RemotingConfiguration.Configure llamada.

Propiedades

Next

Obtiene o establece el siguiente proveedor de receptor en la cadena de proveedores de receptores del canal.

Métodos

CreateSink(IChannelSender, String, Object)

Crea una cadena de receptores.

Se aplica a