public class TcpClientChannel : IChannelSender, IChannel
|
Channels transport messages between applications across remoting boundaries (for example application domains, processes, and machines). The current channel sends outbound messages to an endpoint specified by the message. TcpClientChannel converts the messages sent along it to binary format, and sends them using the TCP protocol.
If there are common language runtimes at both ends of the channel, then a session is created between the two ends, in order to connect the client and server sink chains on either side of the boundary together. The client channel is located at the end of the 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 an instance of the TcpServerChannel class. 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, but 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. |
machineName | A string that specifies the machine name used with the current channel. Overrides the machine name 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 TcpClientChannel class with default values. |
ctor #2 | Overloaded:.ctor(IDictionary properties, IClientChannelSinkProvider sinkProvider) Initializes a new instance of the TcpClientChannel class with the specified channel properties and IClientChannelSinkProvider. |
ctor #3 | Overloaded:.ctor(string name, IClientChannelSinkProvider sinkProvider) Initializes a new instance of the TcpClientChannel class with the provided name and IClientChannelSinkProvider. |
ChannelName | Read-only Gets the name of the current channel. |
ChannelPriority | Read-only Returns the priority of the current channel. |
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. |
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. |
ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
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 TcpClientChannel(); |
public TcpClientChannel( |
properties
sinkProvider
Exception Type | Condition |
---|---|
ArgumentException | A provided channel property was badly formatted. |
public TcpClientChannel( |
name
sinkProvider
public string ChannelName {get;}
|
public int ChannelPriority {get;}
|
public virtual IMessageSink CreateMessageSink( |
url
remoteChannelData
objectURI
~TcpClientChannel(); |
public virtual int GetHashCode(); |
public Type GetType(); |
protected object MemberwiseClone(); |
url
objectURI
public virtual string ToString(); |