TcpServerChannel Construtores
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Inicializa uma nova instância da TcpServerChannel classe que escuta na porta especificada.
Sobrecargas
| Nome | Description |
|---|---|
| TcpServerChannel(Int32) |
Inicializa uma nova instância da TcpServerChannel classe que escuta na porta especificada. |
| TcpServerChannel(IDictionary, IServerChannelSinkProvider) |
Inicializa uma nova instância da TcpServerChannel classe com as propriedades de canal e o coletor especificados. |
| TcpServerChannel(String, Int32) |
Inicializa uma nova instância da TcpServerChannel classe com o nome fornecido e que escuta na porta especificada. |
| TcpServerChannel(IDictionary, IServerChannelSinkProvider, IAuthorizeRemotingConnection) |
Inicializa uma nova instância da TcpServerChannel classe com as propriedades do canal, o coletor e o provedor de autorização especificados. |
| TcpServerChannel(String, Int32, IServerChannelSinkProvider) |
Inicializa uma nova instância da TcpServerChannel classe com o nome fornecido, que escuta na porta especificada e usa o coletor especificado. |
TcpServerChannel(Int32)
Inicializa uma nova instância da TcpServerChannel classe que escuta na porta especificada.
public:
TcpServerChannel(int port);
public TcpServerChannel(int port);
new System.Runtime.Remoting.Channels.Tcp.TcpServerChannel : int -> System.Runtime.Remoting.Channels.Tcp.TcpServerChannel
Public Sub New (port As Integer)
Parâmetros
- port
- Int32
A porta na qual o canal escuta.
Exemplos
O exemplo de código a seguir mostra o uso desse construtor.
// Set up a server channel.
TcpServerChannel^ serverChannel = gcnew TcpServerChannel( 9090 );
ChannelServices::RegisterChannel( serverChannel );
// Set up a server channel.
TcpServerChannel serverChannel = new TcpServerChannel(9090);
ChannelServices.RegisterChannel(serverChannel);
Comentários
Para solicitar que uma porta disponível seja atribuída dinamicamente, defina o port parâmetro como 0 (zero).
Aplica-se a
TcpServerChannel(IDictionary, IServerChannelSinkProvider)
Inicializa uma nova instância da TcpServerChannel classe com as propriedades de canal e o coletor especificados.
public:
TcpServerChannel(System::Collections::IDictionary ^ properties, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ sinkProvider);
public TcpServerChannel(System.Collections.IDictionary properties, System.Runtime.Remoting.Channels.IServerChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Tcp.TcpServerChannel : System.Collections.IDictionary * System.Runtime.Remoting.Channels.IServerChannelSinkProvider -> System.Runtime.Remoting.Channels.Tcp.TcpServerChannel
Public Sub New (properties As IDictionary, sinkProvider As IServerChannelSinkProvider)
Parâmetros
- properties
- IDictionary
Uma IDictionary coleção que especifica valores para propriedades de configuração a serem usadas pelo canal.
- sinkProvider
- IServerChannelSinkProvider
A IServerChannelSinkProvider implementação a ser usada pelo canal.
Exceções
Uma propriedade de canal fornecida foi mal formatada.
Exemplos
O exemplo de código a seguir mostra o uso desse construtor para criar um TcpServerChannel objeto com propriedades de configuração específicas.
// Specify server channel properties.
IDictionary^ dict = gcnew Hashtable;
dict[ "port" ] = 9090;
dict[ "authenticationMode" ] = "IdentifyCallers";
// Set up a server channel.
TcpServerChannel^ serverChannel = gcnew TcpServerChannel( dict, nullptr );
ChannelServices::RegisterChannel( serverChannel, false );
// Specify server channel properties.
IDictionary dict = new Hashtable();
dict["port"] = 9090;
dict["authenticationMode"] = "IdentifyCallers";
// Set up a server channel.
TcpServerChannel serverChannel = new TcpServerChannel(dict, null);
ChannelServices.RegisterChannel(serverChannel, false);
Comentários
Observação
Se você não precisar da funcionalidade do coletor, defina o sinkProvider parâmetro como null.
Aplica-se a
TcpServerChannel(String, Int32)
Inicializa uma nova instância da TcpServerChannel classe com o nome fornecido e que escuta na porta especificada.
public:
TcpServerChannel(System::String ^ name, int port);
public TcpServerChannel(string name, int port);
new System.Runtime.Remoting.Channels.Tcp.TcpServerChannel : string * int -> System.Runtime.Remoting.Channels.Tcp.TcpServerChannel
Public Sub New (name As String, port As Integer)
Parâmetros
- name
- String
O nome do canal.
- port
- Int32
A porta na qual o canal escuta.
Exemplos
O exemplo de código a seguir mostra como construir um TcpServerChannel.
// Create the server channel.
TcpServerChannel^ channel = gcnew TcpServerChannel( "Server Channel",9090 );
// Create the server channel.
TcpServerChannel channel = new TcpServerChannel(
"Server Channel", 9090);
Comentários
Esse construtor define a ChannelName propriedade usando o name parâmetro. Se você quiser registrar mais de um canal, cada canal deverá ter um nome exclusivo.
Para solicitar que uma porta disponível seja atribuída dinamicamente, defina o port parâmetro como 0 (zero).
Aplica-se a
TcpServerChannel(IDictionary, IServerChannelSinkProvider, IAuthorizeRemotingConnection)
Inicializa uma nova instância da TcpServerChannel classe com as propriedades do canal, o coletor e o provedor de autorização especificados.
public:
TcpServerChannel(System::Collections::IDictionary ^ properties, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ sinkProvider, System::Runtime::Remoting::Channels::IAuthorizeRemotingConnection ^ authorizeCallback);
public TcpServerChannel(System.Collections.IDictionary properties, System.Runtime.Remoting.Channels.IServerChannelSinkProvider sinkProvider, System.Runtime.Remoting.Channels.IAuthorizeRemotingConnection authorizeCallback);
new System.Runtime.Remoting.Channels.Tcp.TcpServerChannel : System.Collections.IDictionary * System.Runtime.Remoting.Channels.IServerChannelSinkProvider * System.Runtime.Remoting.Channels.IAuthorizeRemotingConnection -> System.Runtime.Remoting.Channels.Tcp.TcpServerChannel
Public Sub New (properties As IDictionary, sinkProvider As IServerChannelSinkProvider, authorizeCallback As IAuthorizeRemotingConnection)
Parâmetros
- properties
- IDictionary
Uma IDictionary coleção que especifica valores para propriedades de configuração a serem usadas pelo canal.
- sinkProvider
- IServerChannelSinkProvider
A IServerChannelSinkProvider implementação a ser usada pelo canal.
- authorizeCallback
- IAuthorizeRemotingConnection
A IAuthorizeRemotingConnection implementação a ser usada pelo canal.
Exceções
Uma propriedade de canal fornecida foi mal formatada.
Aplica-se a
TcpServerChannel(String, Int32, IServerChannelSinkProvider)
Inicializa uma nova instância da TcpServerChannel classe com o nome fornecido, que escuta na porta especificada e usa o coletor especificado.
public:
TcpServerChannel(System::String ^ name, int port, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ sinkProvider);
public TcpServerChannel(string name, int port, System.Runtime.Remoting.Channels.IServerChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Tcp.TcpServerChannel : string * int * System.Runtime.Remoting.Channels.IServerChannelSinkProvider -> System.Runtime.Remoting.Channels.Tcp.TcpServerChannel
Public Sub New (name As String, port As Integer, sinkProvider As IServerChannelSinkProvider)
Parâmetros
- name
- String
O nome do canal.
- port
- Int32
A porta na qual o canal escuta.
- sinkProvider
- IServerChannelSinkProvider
A IServerChannelSinkProvider implementação a ser usada pelo canal.
Exemplos
O exemplo de código a seguir mostra como construir um TcpServerChannel.
// Create the server channel.
TcpServerChannel^ channel = gcnew TcpServerChannel(
L"Server Channel",9090,nullptr );
// Create the server channel.
TcpServerChannel channel = new TcpServerChannel(
"Server Channel", 9090, null);
Comentários
Esse construtor define a ChannelName propriedade usando o name parâmetro. Se você quiser registrar mais de um canal, cada canal deverá ter um nome exclusivo.
Para solicitar que uma porta disponível seja atribuída dinamicamente, defina o port parâmetro como 0 (zero).
Se você não precisar da funcionalidade do coletor, defina o sinkProvider parâmetro como null.