次の方法で共有


TcpChannel コンストラクタ (IDictionary, IClientChannelSinkProvider, IServerChannelSinkProvider)

構成プロパティとシンクを指定して、TcpChannel クラスの新しいインスタンスを初期化します。

名前空間: System.Runtime.Remoting.Channels.Tcp
アセンブリ: System.Runtime.Remoting (system.runtime.remoting.dll 内)

構文

'宣言
Public Sub New ( _
    properties As IDictionary, _
    clientSinkProvider As IClientChannelSinkProvider, _
    serverSinkProvider As IServerChannelSinkProvider _
)
'使用
Dim properties As IDictionary
Dim clientSinkProvider As IClientChannelSinkProvider
Dim serverSinkProvider As IServerChannelSinkProvider

Dim instance As New TcpChannel(properties, clientSinkProvider, serverSinkProvider)
public TcpChannel (
    IDictionary properties,
    IClientChannelSinkProvider clientSinkProvider,
    IServerChannelSinkProvider serverSinkProvider
)
public:
TcpChannel (
    IDictionary^ properties, 
    IClientChannelSinkProvider^ clientSinkProvider, 
    IServerChannelSinkProvider^ serverSinkProvider
)
public TcpChannel (
    IDictionary properties, 
    IClientChannelSinkProvider clientSinkProvider, 
    IServerChannelSinkProvider serverSinkProvider
)
public function TcpChannel (
    properties : IDictionary, 
    clientSinkProvider : IClientChannelSinkProvider, 
    serverSinkProvider : IServerChannelSinkProvider
)

パラメータ

  • properties
    クライアント チャネルとサーバー チャネルによって使用される構成プロパティの値を指定する IDictionary コレクション。

例外

例外の種類 条件

ArgumentException

指定したチャネル プロパティの書式が不適切です。

解説

チャネル構成プロパティの詳細については、「チャネルおよびフォーマッタの構成プロパティ」を参照してください。

注意

サーバー コンピュータで Windows 95/98/Me が実行されている場合、そのサーバーの TcpChannel をセキュリティ保護の対象として指定することはできません。

チャネル シンクは、そのチャネルを流れている基になるメッセージにアクセスできるようにするプラグイン ポイント、およびリモート オブジェクトにメッセージを送信するためにトランスポート機構が使用するストリームを提供します。チャネル シンクは、クライアントとサーバー間でのメッセージの転送も行います。チャネル シンクはチェインで互いにリンクされ、すべてのチャネル メッセージはこのシンクのチェインを流れ、メッセージは最終的にシリアル化されて転送されます。シンク機能が不要な場合は、clientSinkProvider パラメータおよび serverSinkProvider パラメータを null 参照 (Visual Basic では Nothing) に設定します。

使用例

このコンストラクタを使用するコードの例を次に示します。

// Specify the properties for the server channel.
System.Collections.IDictionary dict = 
    new System.Collections.Hashtable();
dict["port"] = 9090;
dict["authenticationMode"] = "IdentifyCallers";
 
// Set up the server channel.
TcpChannel serverChannel = new TcpChannel(dict, null, null);
ChannelServices.RegisterChannel(serverChannel);    
// Specify the properties for the server channel.
System::Collections::IDictionary^ dict = gcnew System::Collections::Hashtable;
dict[ "port" ] = 9090;
dict[ "authenticationMode" ] = "IdentifyCallers";

// Set up the server channel.
TcpChannel^ serverChannel = gcnew TcpChannel( dict,nullptr,nullptr );
ChannelServices::RegisterChannel( serverChannel );

.NET Framework のセキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「」を参照してください。

プラットフォーム

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1、1.0

参照

関連項目

TcpChannel クラス
TcpChannel メンバ
System.Runtime.Remoting.Channels.Tcp 名前空間

その他の技術情報

チャネルおよびフォーマッタの構成プロパティ