Channels

Up Java Resources C++ Resources Comp410

A channel is an object that establishes communication between a client and a remote object lying across application domain boundaries. The .NET Framework implements two default channel classes:

 HttpChannel: Implements a channel that uses the HTTP protocol. 

TcpChannel: Implements a channel that uses the TCP protocol (Transmission Control Protocol).

Both of these classes implement both a client channel (used on the client side to communicate with remote objects), and a server channel (used on the server side to communicate with clients).

The HttpChannel class formats messages using the SOAP protocol, which encodes communications as XML. However, the TcpChannel class uses a binary format for encoding messages. The binary formatting is more efficient since the formatted messages are smaller. The plain text format of SOAP, however, is much less likely to have problems with firewalls and other network security measures.

If you're working with a local network connection then it's best to use TCP because of it's enhanced performance over using HTTP. If you're working over the Internet then HTTP can sometimes be the only choice depending on firewall configurations. If one does not have control over the firewall, almost all firewalls can be configured to allow TCP traffic through on the port you've chosen to use for your object.

When one creates a server, one also defines and registers one or more channels for the class and then associate each channel with a specific port. Registering a channel/port combination is a way of telling the .NET infrastructure to listen on that port for messages intended for that channel. When a message arrives, the framework routes it to the correct server object.