9.1. Channels

Channels are objects that help transport messages between objects in a remoting relationship. The .NET Framework comes configured with two channels: one that uses TCP as the transport protocol and another that uses HTTP. Each uses SOAP as its message format, but the TCP channel encodes it into a proprietary binary format, while the HTTP channel uses XML. The HTTP channel is ideal when firewalls must be traversed, but otherwise, it is best to use the TCP channel for its pure speed.

Although .NET is configured to use TCP and HTTP out of the box, the remoting framework is completely extensible. .NET ships with channel objects that implement two of the most popular protocols, but anyone can write a channel using any protocol, and it will plug right into the remoting infrastructure as long as the specifications are adhered to.

9.1.1. Activation Models

Remote objects fall into two major categories: server-activated objects (SAOs) and client-activated objects (CAOs).

SAOs are also referred to as "well-known" objects, probably because no mechanism for object discovery is inherently built into the remoting architecture. Compare this feature to the TCP/IP "well-known ports," which refer to ports such as 25 (SMTP), 80 (HTTP), and 110 (POP3). Clients using well-known objects have a priori knowledge of the object's location.

When a client requests an SAO, it is initially given a proxy object that resembles the object located on the server. However, the object on the ...

Get Object-Oriented Programming with Visual Basic .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.