TcpClientChannel Construtores
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Inicializa uma nova instância da TcpClientChannel classe.
Sobrecargas
| Name | Description |
|---|---|
| TcpClientChannel() |
Inicializa uma nova instância da TcpClientChannel classe. |
| TcpClientChannel(IDictionary, IClientChannelSinkProvider) |
Inicializa uma nova instância da TcpClientChannel classe com as propriedades de configuração e o sink especificados. |
| TcpClientChannel(String, IClientChannelSinkProvider) |
Inicializa uma nova instância da TcpClientChannel classe com o nome e o sumidouro especificados. |
TcpClientChannel()
Inicializa uma nova instância da TcpClientChannel classe.
public:
TcpClientChannel();
public TcpClientChannel();
Public Sub New ()
Exemplos
O seguinte exemplo de código mostra a utilização deste construtor.
// Set up a client channel.
TcpClientChannel^ clientChannel = gcnew TcpClientChannel;
ChannelServices::RegisterChannel( clientChannel );
// Set up a client channel.
TcpClientChannel clientChannel = new TcpClientChannel();
ChannelServices.RegisterChannel(clientChannel);
Observações
As propriedades de configuração da TcpClientChannel instância devolvida por este construtor estão todas definidas para os seus valores padrão.
Aplica-se a
TcpClientChannel(IDictionary, IClientChannelSinkProvider)
Inicializa uma nova instância da TcpClientChannel classe com as propriedades de configuração e o sink 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
Uma IDictionary coleção que especifica valores para propriedades de configuração a serem usadas pelo canal.
- sinkProvider
- IClientChannelSinkProvider
A IServerChannelSinkProvider implementação a ser usada pelo canal.
Exceções
Uma propriedade de configuração estava formatada incorretamente.
Exemplos
O exemplo de código seguinte mostra a utilização deste construtor para criar um TcpClientChannel objeto com propriedades de configuração 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);
Observações
Para mais informações sobre as propriedades de configuração do canal, consulte Propriedades de Configuração de Canal e Formator.
Se não precisar de funcionalidade de sink, defina o sinkProvider parâmetro para null.
Ver também
Aplica-se a
TcpClientChannel(String, IClientChannelSinkProvider)
Inicializa uma nova instância da TcpClientChannel classe com o nome e o sumidouro 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
O nome do canal.
- sinkProvider
- IClientChannelSinkProvider
A IClientChannelSinkProvider implementação a ser usada pelo canal.
Exemplos
O exemplo de código seguinte mostra como construir um TcpClientChannel.
// Create the channel.
TcpClientChannel^ clientChannel = gcnew TcpClientChannel( "Client",nullptr );
// Create the channel.
TcpClientChannel clientChannel = new TcpClientChannel("Client", null);
Observações
Este construtor define a ChannelName propriedade usando o name parâmetro. Se quiser registar mais do que um canal, cada canal deve ter um nome único.
Se não precisar de funcionalidade de sink, defina o sinkProvider parâmetro para null.