TcpClientChannel Constructores

Definición

Inicializa una nueva instancia de la clase TcpClientChannel.

Sobrecargas

Nombre Description
TcpClientChannel()

Inicializa una nueva instancia de la clase TcpClientChannel.

TcpClientChannel(IDictionary, IClientChannelSinkProvider)

Inicializa una nueva instancia de la TcpClientChannel clase con las propiedades de configuración y el receptor especificados.

TcpClientChannel(String, IClientChannelSinkProvider)

Inicializa una nueva instancia de la TcpClientChannel clase con el nombre y el receptor especificados.

TcpClientChannel()

Inicializa una nueva instancia de la clase TcpClientChannel.

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

Ejemplos

En el ejemplo de código siguiente se muestra el uso de este constructor.

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

Comentarios

Las propiedades de configuración de la TcpClientChannel instancia devuelta por este constructor se establecen en sus valores predeterminados.

Se aplica a

TcpClientChannel(IDictionary, IClientChannelSinkProvider)

Inicializa una nueva instancia de la TcpClientChannel clase con las propiedades de configuración y el receptor especificados.

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)

Parámetros

properties
IDictionary

Colección IDictionary que especifica valores para las propiedades de configuración que va a usar el canal.

sinkProvider
IClientChannelSinkProvider

Implementación IServerChannelSinkProvider que va a usar el canal.

Excepciones

Se ha aplicado un formato incorrecto a una propiedad de configuración.

Ejemplos

En el ejemplo de código siguiente se muestra el uso de este constructor para crear un TcpClientChannel objeto con propiedades de configuración específicas.

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

Comentarios

Si no necesita funcionalidad de receptor, establezca el sinkProvider parámetro nullen .

Se aplica a

TcpClientChannel(String, IClientChannelSinkProvider)

Inicializa una nueva instancia de la TcpClientChannel clase con el nombre y el receptor especificados.

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)

Parámetros

name
String

Nombre del canal.

sinkProvider
IClientChannelSinkProvider

Implementación IClientChannelSinkProvider que va a usar el canal.

Ejemplos

En el ejemplo de código siguiente se muestra cómo construir un TcpClientChannel.

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

Comentarios

Este constructor establece la ChannelName propiedad mediante el name parámetro . Si desea registrar más de un canal, cada canal debe tener un nombre único.

Si no necesita funcionalidad de receptor, establezca el sinkProvider parámetro nullen .

Se aplica a