public class HttpClientChannel : BaseChannelWithProperties, IChannelSender, IChannel
|
Channels transport messages between applications across remoting boundaries (for example application domains, processes, and machines). These crossings include both inbound and outbound.
If there are common language runtimes at both ends of the channel, then a session is created between the two ends, to connect the client and server sink chains on either side of the boundary together. The client channel is located at the end of client context sink chain. The server channel is located at the start of the server context sink chain. Messages are delivered to the client channel, travel through it, and are received by the HttpServerChannel. The server channel then deserializes the messages and delivers them to the first server context sink.
IChannel implementations use channel configuration properties to configure the channel at run time. Channel properties can be specified in a configuration file, or programmatically, inside of an IDictionary. In a configuration file, all values are represented by strings, but when building a property IDictionary programmatically, value types can be specified with their native values or with strings.
The following table shows the channel configuration properties that can be specified for the current channel.
Property | Description |
---|---|
name | Indicates the name of the channel. This property is used to retrieve a specific channel when calling ChannelServices.GetChannel . If this property is not set, the system defaults to "http". If you want to register more than one HttpChannel , each must have a unique name. Set this property to the String.Empty string ("") if you want to ignore names and avoid naming collisions. The system will allow any number of channels with the String.Empty name. |
priority | An integer representing the priority assigned to this channel. Higher numbers indicate a higher chance of being chosen to connect first. The default priority is 1, and negative numbers are allowed. |
clientConnectionLimit | An integer indicating how many connections can be simultaneously opened to a given server. The default is 2. |
proxyName | The name of the proxy computer. |
proxyPort | An integer specifying the proxy port. |
machineName | A string that specifies the machine name used with the current channel. Overrides the machine name specified in the channel data object. |
ctor #1 | Overloaded:.ctor() Default constructor. This constructor is called by derived class constructors to initialize state in this type.Initializes a new instance of the HttpClientChannel class with default values. |
ctor #2 | Overloaded:.ctor(IDictionary properties, IClientChannelSinkProvider sinkProvider) Initializes a new instance of the HttpClientChannel class with the specified channel properties and IClientChannelSinkProvider. |
ctor #3 | Overloaded:.ctor(string name, IClientChannelSinkProvider sinkProvider) Initializes a new instance of the HttpClientChannel class with the specified channel name and IClientChannelSinkProvider. |
ChannelName | Read-only Gets the name of the current channel. |
ChannelPriority | Read-only Returns the priority of the current channel. |
Count (inherited from System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties) |
Read-only See base class member description: System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties.Count Gets the number of properties associated with the current channel object. |
IsFixedSize (inherited from System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties) |
Read-only See base class member description: System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties.IsFixedSize Gets a Boolean value indicating whether the number of properties that can be entered into the current channel object is fixed. |
IsReadOnly (inherited from System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties) |
Read-only See base class member description: System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties.IsReadOnly Gets a Boolean value indicating whether the collection of properties in the current channel object is read-only. |
IsSynchronized (inherited from System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties) |
Read-only See base class member description: System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties.IsSynchronized Gets a value indicating whether the current dictionary of channel object properties is synchronized. |
Item | Read-write Overridden: Gets or sets a channel property associated with the specified key. |
Keys | Read-only Overridden: Gets an ICollection of keys that the channel properties are associated with. |
Properties (inherited from System.Runtime.Remoting.Channels.BaseChannelWithProperties) |
Read-only See base class member description: System.Runtime.Remoting.Channels.BaseChannelWithProperties.Properties Gets an IDictionary of the channel properties associated with the current channel object. |
SyncRoot (inherited from System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties) |
Read-only See base class member description: System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties.SyncRoot Gets an object that is used to synchronize access to the BaseChannelObjectWithProperties. |
Values (inherited from System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties) |
Read-only See base class member description: System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties.Values Gets an ICollection of the values of the properties associated with the current channel object. |
Add (inherited from System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties) |
See base class member description: System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties.Add The current method must not be implemented because it does not apply to the way IDictionary is being used in this case, and because BaseChannelObjectWithProperties.IsFixedSize returns true. |
Clear (inherited from System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties) |
See base class member description: System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties.Clear The current method must not be implemented because it does not apply to the way IDictionary is being used in this case, and because BaseChannelObjectWithProperties.IsFixedSize returns true. |
Contains (inherited from System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties) |
See base class member description: System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties.Contains Returns a Boolean value indicating whether the current channel object contains a property associated with the specified key. |
CopyTo (inherited from System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties) |
See base class member description: System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties.CopyTo The current method is not supported by the BaseChannelObjectWithProperties. |
CreateMessageSink | Returns a channel message sink that delivers messages to the specified URL or channel data object. |
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
GetEnumerator (inherited from System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties) |
See base class member description: System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties.GetEnumerator Returns an IDictionaryEnumerator that enumerates over all the properties associated with the current channel object. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
Parse | Extracts the channel URI and the remote well-known object URI from the specified URL. |
Remove (inherited from System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties) |
See base class member description: System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties.Remove The current method must not be implemented because it does not apply to the way IDictionary is being used in this case, and because BaseChannelObjectWithProperties.IsFixedSize returns true. |
ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
SinksWithProperties (inherited from System.Runtime.Remoting.Channels.BaseChannelWithProperties) |
See base class member description: System.Runtime.Remoting.Channels.BaseChannelWithProperties.SinksWithProperties Indicates the top channel sink in the channel sink stack. |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public HttpClientChannel(); |
public HttpClientChannel( |
properties
sinkProvider
Exception Type | Condition |
---|---|
ArgumentException | A provided channel property was badly formatted. |
public HttpClientChannel( |
name
sinkProvider
protected IChannelSinkBase SinksWithProperties;
|
public string ChannelName {get;}
|
public int ChannelPriority {get;}
|
public virtual int Count {get;}
|
public virtual bool IsFixedSize {get;}
|
public virtual bool IsReadOnly {get;}
|
public virtual bool IsSynchronized {get;}
|
public override object this[object key] {get; set;}
|
key
public override ICollection Keys {get;}
|
public override IDictionary Properties {get;}
|
public virtual object SyncRoot {get;}
|
public virtual ICollection Values {get;}
|
key
value
Exception Type | Condition |
---|---|
NotSupportedException | The method was called. |
public virtual void Clear(); |
Exception Type | Condition |
---|---|
NotSupportedException | The method was called. |
key
array
index
Exception Type | Condition |
---|---|
NotSupportedException | The method was called. |
public virtual IMessageSink CreateMessageSink( |
url
remoteChannelData
objectURI
~HttpClientChannel(); |
public virtual IDictionaryEnumerator GetEnumerator(); |
public virtual int GetHashCode(); |
public Type GetType(); |
protected object MemberwiseClone(); |
url
objectURI
public virtual void Remove( |
key
Exception Type | Condition |
---|---|
NotSupportedException | The method was called. |
public virtual string ToString(); |