Compartilhar via


HttpServerChannel Construtores

Definição

Inicializa uma nova instância da classe HttpServerChannel.

Sobrecargas

HttpServerChannel()

Inicializa uma nova instância da classe HttpServerChannel.

HttpServerChannel(Int32)

Inicializa uma nova instância da classe HttpServerChannel que escuta na porta especificada.

HttpServerChannel(IDictionary, IServerChannelSinkProvider)

Inicializa uma nova instância da classe HttpServerChannel com as propriedades de canal e os coletores especificados.

HttpServerChannel(String, Int32)

Inicializa uma nova instância da classe HttpServerChannel com o nome fornecido e que escuta na porta especificada.

HttpServerChannel(String, Int32, IServerChannelSinkProvider)

Inicializa uma nova instância da classe HttpServerChannel na porta especificada com o nome fornecido, que escuta na porta especificada e usa o coletor especificado.

HttpServerChannel()

Inicializa uma nova instância da classe HttpServerChannel.

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

Aplica-se a

HttpServerChannel(Int32)

Inicializa uma nova instância da classe HttpServerChannel 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

A porta na qual o canal escuta.

Comentários

Para solicitar que uma porta disponível seja atribuída dinamicamente, defina o port parâmetro como 0 (zero).

Aplica-se a

HttpServerChannel(IDictionary, IServerChannelSinkProvider)

Inicializa uma nova instância da classe HttpServerChannel com as propriedades de canal e os coletores 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

Um IDictionary das propriedades de canal que contêm as informações de configuração para o canal atual.

sinkProvider
IServerChannelSinkProvider

O IServerChannelSinkProvider a ser usado com a nova instância do HttpServerChannel.

Exceções

Uma propriedade de configuração foi formatada incorretamente.

Exemplos

O exemplo de código a seguir mostra como usar esse 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);

Comentários

Para obter mais informações sobre as propriedades de configuração de canal, consulte Propriedades de configuração de canal e formatador.

Se você não precisar da funcionalidade do coletor, defina o sinkProvider parâmetro como null.

Confira também

Aplica-se a

HttpServerChannel(String, Int32)

Inicializa uma nova instância da classe HttpServerChannel com o nome fornecido 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

A porta na qual o canal escuta.

Exemplos

O exemplo de código a seguir mostra como usar esse 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);

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

HttpServerChannel(String, Int32, IServerChannelSinkProvider)

Inicializa uma nova instância da classe HttpServerChannel na porta especificada com o nome fornecido, que escuta na porta especificada e usa o coletor 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

A porta na qual o canal escuta.

sinkProvider
IServerChannelSinkProvider

O IServerChannelSinkProvider a ser usado pelo canal.

Exemplos

O exemplo de código a seguir mostra como usar esse 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);

Comentários

Esse construtor define a ChannelName propriedade usando o name parâmetro .

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.

Aplica-se a