HttpServerChannel 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 HttpServerChannel classe.
Sobrecargas
| Name | Description |
|---|---|
| HttpServerChannel() |
Inicializa uma nova instância da HttpServerChannel classe. |
| HttpServerChannel(Int32) |
Inicializa uma nova instância da HttpServerChannel classe que escuta na porta especificada. |
| HttpServerChannel(IDictionary, IServerChannelSinkProvider) |
Inicializa uma nova instância da HttpServerChannel classe com as propriedades do canal e o sumidouro especificados. |
| HttpServerChannel(String, Int32) |
Inicializa uma nova instância da HttpServerChannel classe com o nome próprio e que escuta na porta especificada. |
| HttpServerChannel(String, Int32, IServerChannelSinkProvider) |
Inicializa uma nova instância da HttpServerChannel classe na porta especificada com o nome próprio, que ouve na porta especificada e utiliza o sumidouro especificado. |
HttpServerChannel()
Inicializa uma nova instância da HttpServerChannel classe.
public:
HttpServerChannel();
public HttpServerChannel();
Public Sub New ()
Aplica-se a
HttpServerChannel(Int32)
Inicializa uma nova instância da HttpServerChannel classe que escuta na porta especificada.
public:
HttpServerChannel(int port);
public HttpServerChannel(int port);
new System.Runtime.Remoting.Channels.Http.HttpServerChannel : int -> System.Runtime.Remoting.Channels.Http.HttpServerChannel
Public Sub New (port As Integer)
Parâmetros
- port
- Int32
O port onde o canal ouve.
Observações
Para pedir que uma porta disponível seja atribuída dinamicamente, defina o port parâmetro para 0 (zero).
Aplica-se a
HttpServerChannel(IDictionary, IServerChannelSinkProvider)
Inicializa uma nova instância da HttpServerChannel classe com as propriedades do canal e o sumidouro especificados.
public:
HttpServerChannel(System::Collections::IDictionary ^ properties, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ sinkProvider);
public HttpServerChannel(System.Collections.IDictionary properties, System.Runtime.Remoting.Channels.IServerChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Http.HttpServerChannel : System.Collections.IDictionary * System.Runtime.Remoting.Channels.IServerChannelSinkProvider -> System.Runtime.Remoting.Channels.Http.HttpServerChannel
Public Sub New (properties As IDictionary, sinkProvider As IServerChannelSinkProvider)
Parâmetros
- properties
- IDictionary
A IDictionary das propriedades do canal que detêm a informação de configuração para o canal atual.
- sinkProvider
- IServerChannelSinkProvider
O IServerChannelSinkProvider para usar com a nova instância do HttpServerChannel.
Exceções
Uma propriedade de configuração estava formatada incorretamente.
Exemplos
O seguinte exemplo de código mostra como usar este construtor.
System::Collections::Hashtable^ properties = gcnew System::Collections::Hashtable;
properties->default[ L"port" ] = 9090;
IServerChannelSinkProvider^ sinkProvider = nullptr;
HttpServerChannel^ serverChannel = gcnew HttpServerChannel( properties,sinkProvider );
System.Collections.Hashtable properties =
new System.Collections.Hashtable();
properties["port"] = 9090;
IServerChannelSinkProvider sinkProvider = null;
HttpServerChannel serverChannel = new HttpServerChannel(
properties, sinkProvider);
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
HttpServerChannel(String, Int32)
Inicializa uma nova instância da HttpServerChannel classe com o nome próprio e que escuta na porta especificada.
public:
HttpServerChannel(System::String ^ name, int port);
public HttpServerChannel(string name, int port);
new System.Runtime.Remoting.Channels.Http.HttpServerChannel : string * int -> System.Runtime.Remoting.Channels.Http.HttpServerChannel
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 seguinte exemplo de código mostra como usar este construtor.
String^ name = L"RemotingServer";
int port = 9090;
HttpServerChannel^ serverChannel = gcnew HttpServerChannel( name,port );
string name = "RemotingServer";
int port = 9090;
HttpServerChannel serverChannel =
new HttpServerChannel(name, port);
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
HttpServerChannel(String, Int32, IServerChannelSinkProvider)
Inicializa uma nova instância da HttpServerChannel classe na porta especificada com o nome próprio, que ouve na porta especificada e utiliza o sumidouro especificado.
public:
HttpServerChannel(System::String ^ name, int port, System::Runtime::Remoting::Channels::IServerChannelSinkProvider ^ sinkProvider);
public HttpServerChannel(string name, int port, System.Runtime.Remoting.Channels.IServerChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Http.HttpServerChannel : string * int * System.Runtime.Remoting.Channels.IServerChannelSinkProvider -> System.Runtime.Remoting.Channels.Http.HttpServerChannel
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 ser usada pelo canal.
Exemplos
O seguinte exemplo de código mostra como usar este construtor.
String^ name = L"RemotingServer";
int port = 9090;
IServerChannelSinkProvider^ sinkProvider = nullptr;
HttpServerChannel^ serverChannel = gcnew HttpServerChannel(
name,port,sinkProvider );
string name = "RemotingServer";
int port = 9090;
IServerChannelSinkProvider sinkProvider = null;
HttpServerChannel serverChannel =
new HttpServerChannel(name, port, sinkProvider);
Observações
Este construtor define a ChannelName propriedade usando o name parâmetro.
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.