TcpClientChannel Constructeurs
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Initialise une nouvelle instance de la classe TcpClientChannel.
Surcharges
| Nom | Description |
|---|---|
| TcpClientChannel() |
Initialise une nouvelle instance de la classe TcpClientChannel. |
| TcpClientChannel(IDictionary, IClientChannelSinkProvider) |
Initialise une nouvelle instance de la TcpClientChannel classe avec les propriétés de configuration et le récepteur spécifiés. |
| TcpClientChannel(String, IClientChannelSinkProvider) |
Initialise une nouvelle instance de la TcpClientChannel classe 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 de l’instance TcpClientChannel retournée par ce constructeur sont toutes définies sur leurs valeurs par défaut.
S’applique à
TcpClientChannel(IDictionary, IClientChannelSinkProvider)
Initialise une nouvelle instance de la TcpClientChannel classe 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 à utiliser par le canal.
- sinkProvider
- IClientChannelSinkProvider
Implémentation IServerChannelSinkProvider à utiliser par le canal.
Exceptions
Une propriété de configuration a été correctement mise en forme.
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
Si vous n’avez pas besoin de fonctionnalités de récepteur, définissez le sinkProvider paramètre nullsur .
S’applique à
TcpClientChannel(String, IClientChannelSinkProvider)
Initialise une nouvelle instance de la TcpClientChannel classe 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 IClientChannelSinkProvider à utiliser 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 ChannelName propriété à l’aide du name paramètre. Si vous souhaitez inscrire plusieurs canaux, chaque canal doit avoir un nom unique.
Si vous n’avez pas besoin de fonctionnalités de récepteur, définissez le sinkProvider paramètre nullsur .