次の方法で共有


TcpClientChannel コンストラクター

定義

TcpClientChannel クラスの新しいインスタンスを初期化します。

オーバーロード

名前 説明
TcpClientChannel()

TcpClientChannel クラスの新しいインスタンスを初期化します。

TcpClientChannel(IDictionary, IClientChannelSinkProvider)

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

TcpClientChannel(String, IClientChannelSinkProvider)

指定した名前とシンクを使用して、 TcpClientChannel クラスの新しいインスタンスを初期化します。

TcpClientChannel()

TcpClientChannel クラスの新しいインスタンスを初期化します。

public:
 TcpClientChannel();
public TcpClientChannel();
Public Sub New ()

次のコード例は、このコンストラクターの使用方法を示しています。

// Set up a client channel.
TcpClientChannel^ clientChannel = gcnew TcpClientChannel;
ChannelServices::RegisterChannel( clientChannel );
// Set up a client channel.
TcpClientChannel clientChannel = new TcpClientChannel();
ChannelServices.RegisterChannel(clientChannel);

注釈

このコンストラクターによって返される TcpClientChannel インスタンスの構成プロパティはすべて既定値に設定されます。

適用対象

TcpClientChannel(IDictionary, IClientChannelSinkProvider)

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

public:
 TcpClientChannel(System::Collections::IDictionary ^ properties, System::Runtime::Remoting::Channels::IClientChannelSinkProvider ^ sinkProvider);
public TcpClientChannel(System.Collections.IDictionary properties, System.Runtime.Remoting.Channels.IClientChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Tcp.TcpClientChannel : System.Collections.IDictionary * System.Runtime.Remoting.Channels.IClientChannelSinkProvider -> System.Runtime.Remoting.Channels.Tcp.TcpClientChannel
Public Sub New (properties As IDictionary, sinkProvider As IClientChannelSinkProvider)

パラメーター

properties
IDictionary

チャネルで使用する構成プロパティの値を指定する IDictionary コレクション。

sinkProvider
IClientChannelSinkProvider

チャネルによって使用される IServerChannelSinkProvider 実装。

例外

構成プロパティの形式が正しくありません。

次のコード例は、このコンストラクターを使用して、特定の構成プロパティを持つ TcpClientChannel オブジェクトを作成する方法を示しています。

// Specify client channel properties.
IDictionary^ dict = gcnew Hashtable;
dict[ "port" ] = 9090;
dict[ "impersonationLevel" ] = "Identify";
dict[ "authenticationPolicy" ] = "AuthPolicy, Policy";

// Set up a client channel.
TcpClientChannel^ clientChannel = gcnew TcpClientChannel( dict, nullptr );
ChannelServices::RegisterChannel( clientChannel, false );
// Specify client channel properties.
IDictionary dict = new Hashtable();
dict["port"] = 9090;
dict["impersonationLevel"] = "Identify";
dict["authenticationPolicy"] = "AuthPolicy, Policy";

// Set up a client channel.
TcpClientChannel clientChannel = new TcpClientChannel(dict, null);
ChannelServices.RegisterChannel(clientChannel, false);

注釈

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

シンク機能が不要な場合は、 sinkProvider パラメーターを null に設定します。

こちらもご覧ください

適用対象

TcpClientChannel(String, IClientChannelSinkProvider)

指定した名前とシンクを使用して、 TcpClientChannel クラスの新しいインスタンスを初期化します。

public:
 TcpClientChannel(System::String ^ name, System::Runtime::Remoting::Channels::IClientChannelSinkProvider ^ sinkProvider);
public TcpClientChannel(string name, System.Runtime.Remoting.Channels.IClientChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Tcp.TcpClientChannel : string * System.Runtime.Remoting.Channels.IClientChannelSinkProvider -> System.Runtime.Remoting.Channels.Tcp.TcpClientChannel
Public Sub New (name As String, sinkProvider As IClientChannelSinkProvider)

パラメーター

name
String

チャネルの名前。

sinkProvider
IClientChannelSinkProvider

チャネルによって使用される IClientChannelSinkProvider 実装。

次のコード例は、 TcpClientChannelを構築する方法を示しています。

// Create the channel.
TcpClientChannel^ clientChannel = gcnew TcpClientChannel( "Client",nullptr );
// Create the channel.
TcpClientChannel clientChannel = new TcpClientChannel("Client", null);

注釈

このコンストラクターは、name パラメーターを使用してChannelName プロパティを設定します。 複数のチャネルを登録する場合は、各チャネルに一意の名前が必要です。

シンク機能が不要な場合は、 sinkProvider パラメーターを null に設定します。

適用対象