Share via


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);

注釈

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

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

こちらもご覧ください

適用対象

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);

注釈

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

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

適用対象