TcpClientChannel Constructeurs

Définition

Initialise une nouvelle instance de la classe TcpClientChannel.

Surcharges

TcpClientChannel()

Initialise une nouvelle instance de la classe TcpClientChannel.

TcpClientChannel(IDictionary, IClientChannelSinkProvider)

Initialise une nouvelle instance de la classe TcpClientChannel avec les propriétés de configuration et le récepteur spécifiés.

TcpClientChannel(String, IClientChannelSinkProvider)

Initialise une nouvelle instance de la classe TcpClientChannel avec le nom et le récepteur spécifiés.

TcpClientChannel()

Initialise une nouvelle instance de la classe TcpClientChannel.

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

Exemples

L’exemple de code suivant montre l’utilisation de ce constructeur.

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

Remarques

Les propriétés de configuration des TcpClientChannel instance retournées par ce constructeur sont toutes définies sur leurs valeurs par défaut.

S’applique à

TcpClientChannel(IDictionary, IClientChannelSinkProvider)

Initialise une nouvelle instance de la classe TcpClientChannel avec les propriétés de configuration et le récepteur spécifiés.

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)

Paramètres

properties
IDictionary

Collection IDictionary qui spécifie les valeurs des propriétés de configuration devant être utilisées par le canal.

sinkProvider
IClientChannelSinkProvider

Implémentation de IServerChannelSinkProvider devant être utilisée par le canal.

Exceptions

Une propriété de configuration a été mise en forme incorrectement.

Exemples

L’exemple de code suivant montre l’utilisation de ce constructeur pour créer un TcpClientChannel objet avec des propriétés de configuration spécifiques.

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

Remarques

Pour plus d’informations sur les propriétés de configuration de canal, consultez Propriétés de configuration du canal et du formateur.

Si vous n’avez pas besoin de la fonctionnalité de récepteur, définissez le paramètre sur sinkProvidernull.

Voir aussi

S’applique à

TcpClientChannel(String, IClientChannelSinkProvider)

Initialise une nouvelle instance de la classe TcpClientChannel avec le nom et le récepteur spécifiés.

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)

Paramètres

name
String

Nom du canal.

sinkProvider
IClientChannelSinkProvider

Implémentation de IClientChannelSinkProvider devant être utilisée par le canal.

Exemples

L’exemple de code suivant montre comment construire un TcpClientChannel.

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

Remarques

Ce constructeur définit la propriété à l’aide ChannelName du name paramètre . Si vous souhaitez inscrire plusieurs canaux, chaque canal doit avoir un nom unique.

Si vous n’avez pas besoin de la fonctionnalité de récepteur, définissez le paramètre sur sinkProvidernull.

S’applique à