Sdílet prostřednictvím


TcpClientChannel Konstruktory

Definice

Inicializuje novou instanci TcpClientChannel třídy .

Přetížení

TcpClientChannel()

Inicializuje novou instanci TcpClientChannel třídy .

TcpClientChannel(IDictionary, IClientChannelSinkProvider)

Inicializuje novou instanci TcpClientChannel třídy se zadanými vlastnostmi konfigurace a jímkou.

TcpClientChannel(String, IClientChannelSinkProvider)

Inicializuje novou instanci TcpClientChannel třídy se zadaným názvem a jímkou.

TcpClientChannel()

Inicializuje novou instanci TcpClientChannel třídy .

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

Příklady

Následující příklad kódu ukazuje použití tohoto konstruktoru.

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

Poznámky

Vlastnosti TcpClientChannel konfigurace instance vrácené tímto konstruktorem jsou nastaveny na výchozí hodnoty.

Platí pro

TcpClientChannel(IDictionary, IClientChannelSinkProvider)

Inicializuje novou instanci TcpClientChannel třídy se zadanými vlastnostmi konfigurace a jímkou.

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)

Parametry

properties
IDictionary

Kolekce IDictionary , která určuje hodnoty vlastností konfigurace, které má kanál použít.

sinkProvider
IClientChannelSinkProvider

Implementace IServerChannelSinkProvider , kterou má kanál použít.

Výjimky

Vlastnost konfigurace byla nesprávně naformátována.

Příklady

Následující příklad kódu ukazuje použití tohoto konstruktoru k vytvoření objektu TcpClientChannel s konkrétními konfiguračními vlastnostmi.

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

Poznámky

Další informace o vlastnostech konfigurace kanálu najdete v tématu Vlastnosti konfigurace kanálu a formátovače.

Pokud funkci jímky nepotřebujete, nastavte sinkProvider parametr na nullhodnotu .

Viz také

Platí pro

TcpClientChannel(String, IClientChannelSinkProvider)

Inicializuje novou instanci TcpClientChannel třídy se zadaným názvem a jímkou.

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)

Parametry

name
String

Název kanálu.

sinkProvider
IClientChannelSinkProvider

Implementace IClientChannelSinkProvider , kterou má kanál použít.

Příklady

Následující příklad kódu ukazuje, jak vytvořit TcpClientChannel.

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

Poznámky

Tento konstruktor nastaví ChannelName vlastnost pomocí parametru name . Pokud chcete zaregistrovat více než jeden kanál, musí mít každý kanál jedinečný název.

Pokud funkci jímky nepotřebujete, nastavte sinkProvider parametr na nullhodnotu .

Platí pro