IServerChannelSinkProviderとは? わかりやすく解説

IServerChannelSinkProvider インターフェイス

リモート処理メッセージが流れているサーバー チャネルのサーバー チャネル シンクを作成します。

名前空間: System.Runtime.Remoting.Channels
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(True)> _
Public Interface IServerChannelSinkProvider
Dim instance As IServerChannelSinkProvider
[ComVisibleAttribute(true)] 
public interface IServerChannelSinkProvider
[ComVisibleAttribute(true)] 
public interface class IServerChannelSinkProvider
/** @attribute ComVisibleAttribute(true) */ 
public interface IServerChannelSinkProvider
ComVisibleAttribute(true) 
public interface IServerChannelSinkProvider
解説解説

チャネル シンクは、IServerChannelSinkProvider インターフェイスの実装をとおしてサーバー チャネルに接続されます。すべてのリモート処理サーバー チャネルには、パラメータとして IServerChannelSinkProvider を受け取るコンストラクタが用意されています。

チャネル シンク プロバイダはチェインに格納されます。外部のチャネル シンク プロバイダをチャネル コンストラクタに渡す場合は、その前にすべてのチャネル シンク プロバイダを 1 つのチェインにまとめます。この処理を実行できるようにするために、IServerChannelSinkProvider は Next というプロパティを提供します。

複数のチャネル シンク プロバイダが構成ファイルで指定されている場合、リモート処理インフラストラクチャは、構成ファイルに出現する順序でそれらのプロバイダをチェインに含めます。チャネル シンク プロバイダは、RemotingConfiguration.Configure 呼び出し中に、チャネルと同時に作成されます。

IMethodCallMessage が生成されると、.NET Framework は登録されたチャネルのリスト内を検索し、この呼び出しを処理できるチャネルを見つけます。適切なチャネルが見つかったら、そのチャネルからチャネル シンクが取得され、IMethodCallMessage が処理のためにそのシンクに転送されます。

使用例使用例

このインターフェイスの実装を示すコード例を次に示します。

public class ServerSinkProvider : IServerChannelSinkProvider
{

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

    public IServerChannelSinkProvider Next
    {
        [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
        get
        {
            return(nextProvider);
        }
        [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
        set
        {
            nextProvider = value;
        }
    }

    [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
    public IServerChannelSink CreateSink (IChannelReceiver channel)
    {

        Console.WriteLine("Creating ServerSink");

        // Create the next sink in the chain.
        IServerChannelSink nextSink = nextProvider.CreateSink(channel);

        // Hook our sink up to it.
        return( new ServerSink(nextSink) );
    }

    [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
    public void GetChannelData (IChannelDataStore
 channelData) {}

    // 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 ServerSinkProvider (IDictionary properties, ICollection
 providerData) {}
    
}
[System::Security::Permissions::PermissionSet(System::Security::
   Permissions::SecurityAction::Demand, Name = "FullTrust")]
public ref class ServerSinkProvider: public
 IServerChannelSinkProvider
{
   // The next provider in the chain.
private:
   IServerChannelSinkProvider^ nextProvider;

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

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

   virtual IServerChannelSink^ CreateSink( IChannelReceiver^ channel )
   {
      Console::WriteLine( "Creating ServerSink" );

      // Create the next sink in the chain.
      IServerChannelSink^ nextSink = nextProvider->CreateSink( channel );

      // Hook our sink up to it.
      return (gcnew ServerSink( nextSink ));
   }

   virtual void GetChannelData( IChannelDataStore^ /*channelData*/
 ){}

   // 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.
   ServerSinkProvider( IDictionary^ /*properties*/, ICollection^ /*providerData*/
 ){}
};
/** @attribute SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.Infrastructure)
*/
public class ServerSinkProvider implements
 IServerChannelSinkProvider
{
    // The next provider in the chain.
    private IServerChannelSinkProvider nextProvider;

    /** @property 
     */
    public IServerChannelSinkProvider get_Next()
    {
        return nextProvider;
    }//get_Next

    /** @property 
     */
    public void set_Next(IServerChannelSinkProvider
 value)
    {
        nextProvider = value;
    }//set_Next

    public IServerChannelSink CreateSink(IChannelReceiver channel)
    {
        Console.WriteLine("Creating ServerSink");
        // Create the next sink in the chain.
        IServerChannelSink nextSink = nextProvider.CreateSink(channel);
        // Hook our sink up to it.
        return new ServerSink(nextSink);
    } //CreateSink

    public void GetChannelData(IChannelDataStore
 channelData)
    {
    } //GetChannelData

    // 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 ServerSinkProvider(IDictionary properties, ICollection
 providerData)
    {
    } //ServerSinkProvider 
} //ServerSinkProvider

対応するサーバー シンクの実装例については、IServerChannelSink インターフェイスのドキュメントを参照してください。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
IServerChannelSinkProvider メンバ
System.Runtime.Remoting.Channels 名前空間

IServerChannelSinkProvider プロパティ


IServerChannelSinkProvider メソッド


パブリック メソッドパブリック メソッド

参照参照

関連項目

IServerChannelSinkProvider インターフェイス
System.Runtime.Remoting.Channels 名前空間

IServerChannelSinkProvider メンバ




英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「IServerChannelSinkProvider」の関連用語

IServerChannelSinkProviderのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



IServerChannelSinkProviderのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS