TcpServerChannel 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 TcpServerChannel classe que escuta na porta especificada.
Sobrecargas
| Name | Descrição |
|---|---|
| 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 do canal e o sumidouro especificados. |
| TcpServerChannel(String, Int32) |
Inicializa uma nova instância da TcpServerChannel classe com o nome próprio e que escuta na porta especificada. |
| TcpServerChannel(IDictionary, IServerChannelSinkProvider, IAuthorizeRemotingConnection) |
Inicializa uma nova instância da TcpServerChannel classe com as propriedades do canal especificadas, o sumidouro e o fornecedor de autorização. |
| TcpServerChannel(String, Int32, IServerChannelSinkProvider) |
Inicializa uma nova instância da TcpServerChannel classe com o nome próprio, que ouve na porta especificada e utiliza o sumidouro 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
O port onde o canal ouve.
Exemplos
O seguinte exemplo de código mostra a utilização deste 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);
Observações
Para pedir que uma porta disponível seja atribuída dinamicamente, defina o port parâmetro para 0 (zero).
Aplica-se a
TcpServerChannel(IDictionary, IServerChannelSinkProvider)
Inicializa uma nova instância da TcpServerChannel classe com as propriedades do canal e o sumidouro 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 estava mal formatada.
Exemplos
O exemplo de código seguinte mostra a utilização deste 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);
Observações
Para mais informações sobre as propriedades de configuração do canal, consulte Propriedades de Configuração de Canal e Formator.
Note
Se não precisar de funcionalidade de sink, defina o sinkProvider parâmetro para null.
Ver também
Aplica-se a
TcpServerChannel(String, Int32)
Inicializa uma nova instância da TcpServerChannel classe com o nome próprio 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
O port onde o canal ouve.
Exemplos
O exemplo de código seguinte 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);
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.
Para pedir que uma porta disponível seja atribuída dinamicamente, defina o port parâmetro para 0 (zero).
Aplica-se a
TcpServerChannel(IDictionary, IServerChannelSinkProvider, IAuthorizeRemotingConnection)
Inicializa uma nova instância da TcpServerChannel classe com as propriedades do canal especificadas, o sumidouro e o fornecedor de autorização.
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 estava mal formatada.
Observações
Para mais informações sobre as propriedades de configuração do canal, consulte Propriedades de Configuração de Canal e Formator.
Ver também
Aplica-se a
TcpServerChannel(String, Int32, IServerChannelSinkProvider)
Inicializa uma nova instância da TcpServerChannel classe com o nome próprio, que ouve na porta especificada e utiliza o sumidouro 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
O port onde o canal ouve.
- sinkProvider
- IServerChannelSinkProvider
A IServerChannelSinkProvider implementação a ser usada pelo canal.
Exemplos
O exemplo de código seguinte 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);
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.
Para pedir que uma porta disponível seja atribuída dinamicamente, defina o port parâmetro para 0 (zero).
Se não precisar de funcionalidade de sink, defina o sinkProvider parâmetro para null.