Edit

Share via


HttpClientChannel Constructors

Definition

Initializes a new instance of the HttpClientChannel class.

Overloads

HttpClientChannel()

Initializes a new instance of the HttpClientChannel class.

HttpClientChannel(IDictionary, IClientChannelSinkProvider)

Initializes a new instance of the HttpClientChannel class with the specified configuration properties and sink.

HttpClientChannel(String, IClientChannelSinkProvider)

Initializes a new instance of the HttpClientChannel class with the specified name and sink.

HttpClientChannel()

Initializes a new instance of the HttpClientChannel class.

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

Remarks

The configuration properties of the HttpClientChannel instance returned by this constructor are all set to their default values.

Applies to

HttpClientChannel(IDictionary, IClientChannelSinkProvider)

Initializes a new instance of the HttpClientChannel class with the specified configuration properties and sink.

public:
 HttpClientChannel(System::Collections::IDictionary ^ properties, System::Runtime::Remoting::Channels::IClientChannelSinkProvider ^ sinkProvider);
public HttpClientChannel (System.Collections.IDictionary properties, System.Runtime.Remoting.Channels.IClientChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Http.HttpClientChannel : System.Collections.IDictionary * System.Runtime.Remoting.Channels.IClientChannelSinkProvider -> System.Runtime.Remoting.Channels.Http.HttpClientChannel
Public Sub New (properties As IDictionary, sinkProvider As IClientChannelSinkProvider)

Parameters

properties
IDictionary

A IDictionary collection that specifies values for configuration properties to be used by the channel.

sinkProvider
IClientChannelSinkProvider

The IClientChannelSinkProvider implementation to be used by the channel.

Exceptions

A configuration property was incorrectly formatted.

Examples

The following code example shows how to use this constructor.

// Create a client channel.
System::Collections::Hashtable^ properties = gcnew System::Collections::Hashtable;
properties->default[ L"port" ] = 9090;
IClientChannelSinkProvider^ sinkProvider = nullptr;
HttpClientChannel^ clientChannel = gcnew HttpClientChannel( properties,sinkProvider );
// Create a client channel.
System.Collections.Hashtable properties =
    new System.Collections.Hashtable();
properties["port"] = 9090;
IClientChannelSinkProvider sinkProvider = null;
HttpClientChannel clientChannel = new HttpClientChannel(
    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

HttpClientChannel(String, IClientChannelSinkProvider)

Initializes a new instance of the HttpClientChannel class with the specified name and sink.

public:
 HttpClientChannel(System::String ^ name, System::Runtime::Remoting::Channels::IClientChannelSinkProvider ^ sinkProvider);
public HttpClientChannel (string name, System.Runtime.Remoting.Channels.IClientChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Http.HttpClientChannel : string * System.Runtime.Remoting.Channels.IClientChannelSinkProvider -> System.Runtime.Remoting.Channels.Http.HttpClientChannel
Public Sub New (name As String, sinkProvider As IClientChannelSinkProvider)

Parameters

name
String

The name of the new instance of the HttpClientChannel.

sinkProvider
IClientChannelSinkProvider

The IClientChannelSinkProvider to be used by the channel.

Examples

The following code example shows how to use this constructor.

// Create a client channel.
String^ name = L"RemotingClient";
IClientChannelSinkProvider^ sinkProvider = nullptr;
HttpClientChannel^ clientChannel = gcnew HttpClientChannel( name,sinkProvider );
// Create a client channel.
string name = "RemotingClient";
IClientChannelSinkProvider sinkProvider = null;
HttpClientChannel clientChannel = new HttpClientChannel(name,
    sinkProvider);

Remarks

This constructor sets the ChannelName property using the name parameter.

Applies to