IClientChannelSinkProvider 接口

定义

为远程处理消息从其流过的客户端信道创建客户端信道接收器。

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
派生
属性

示例

下面的代码示例演示了此接口的实现。

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

IClientChannelSink有关相应客户端接收器实现的示例,请参阅接口文档。

注解

通道接收器通过 接口的 IClientChannelSinkProvider 实现连接到客户端通道。 所有远程处理客户端通道都提供将 IClientChannelSinkProvider 作为参数的构造函数。

通道接收器提供程序存储在链中,用户负责将所有通道接收器提供程序链接在一起,然后再将外部通道接收器提供程序传递给通道构造函数。 IClientChannelSinkProvider 提供为此调用 Next 的属性。

在配置文件中指定多个通道接收器提供程序时,远程处理基础结构将按照它们在配置文件中找到的顺序将它们链接在一起。 在调用期间 RemotingConfiguration.Configure 创建通道时,将创建通道接收器提供程序。

属性

Next

获取或设置信道接收器提供程序链中的下一个接收器提供程序。

方法

CreateSink(IChannelSender, String, Object)

创建接收器链。

适用于