แก้ไข

แชร์ผ่าน


HttpServerChannel Constructors

Definition

Initializes a new instance of the HttpServerChannel class.

Overloads

HttpServerChannel()

Initializes a new instance of the HttpServerChannel class.

HttpServerChannel(Int32)

Initializes a new instance of the HttpServerChannel class that listens on the specified port.

HttpServerChannel(IDictionary, IServerChannelSinkProvider)

Initializes a new instance of the HttpServerChannel class with the specified channel properties and sink.

HttpServerChannel(String, Int32)

Initializes a new instance of the HttpServerChannel class with the given name and that listens on the specified port.

HttpServerChannel(String, Int32, IServerChannelSinkProvider)

Initializes a new instance of the HttpServerChannel class at the specified port with the given name, which listens on the specified port, and uses the specified sink.

HttpServerChannel()

Initializes a new instance of the HttpServerChannel class.

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

Applies to

HttpServerChannel(Int32)

Initializes a new instance of the HttpServerChannel class that listens on the specified port.

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)

Parameters

port
Int32

The port on which the channel listens.

Remarks

To request that an available port be dynamically assigned, set the port parameter to 0 (zero).

Applies to

HttpServerChannel(IDictionary, IServerChannelSinkProvider)

Initializes a new instance of the HttpServerChannel class with the specified channel properties and sink.

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)

Parameters

properties
IDictionary

A IDictionary of the channel properties that hold the configuration information for the current channel.

sinkProvider
IServerChannelSinkProvider

The IServerChannelSinkProvider to use with the new instance of the HttpServerChannel.

Exceptions

A configuration property was incorrectly formatted.

Examples

The following code example shows how to use this constructor.

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);

Remarks

For more information about channel configuration properties, see Channel and Formatter Configuration Properties.

If you do not require sink functionality, set the sinkProvider parameter to null.

See also

Applies to

HttpServerChannel(String, Int32)

Initializes a new instance of the HttpServerChannel class with the given name and that listens on the specified port.

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)

Parameters

name
String

The name of the channel.

port
Int32

The port on which the channel listens.

Examples

The following code example shows how to use this constructor.

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);

Remarks

This constructor sets the ChannelName property by using the name parameter. If you want to register more than one channel, each channel must have a unique name.

To request that an available port be dynamically assigned, set the port parameter to 0 (zero).

Applies to

HttpServerChannel(String, Int32, IServerChannelSinkProvider)

Initializes a new instance of the HttpServerChannel class at the specified port with the given name, which listens on the specified port, and uses the specified sink.

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)

Parameters

name
String

The name of the channel.

port
Int32

The port on which the channel listens.

sinkProvider
IServerChannelSinkProvider

The IServerChannelSinkProvider to be used by the channel.

Examples

The following code example shows how to use this constructor.

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);

Remarks

This constructor sets the ChannelName property using the name parameter.

To request that an available port be dynamically assigned, set the port parameter to 0 (zero).

If you do not require sink functionality, set the sinkProvider parameter to null.

Applies to