The BCL includes a number of types that make accessing networked resources easy. Offering different levels of abstraction, these types allow an application to ignore much of the detail normally required to access networked resources, while retaining a high degree of control.
This section describes the core networking support in the BCL, and
provides numerous examples leveraging the predefined classes. The
types mentioned in this section all exist in the
High-level access is performed using a set of types that implement a generic request/response architecture that is extensible to support new protocols. The implementation of this architecture in the BCL also includes HTTP-specific extensions to make interacting with web servers easy.
Should the application require lower-level access to the network, types exist to support the Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). Finally, in situations where direct transport-level access is required, there are types that provide raw socket access.
The request/response architecture is based on Uniform Resource Indicator (URI) and stream I/O, follows the factory design pattern, and makes good use of abstract types and interfaces.
A factory type
) parses the URI
and creates the appropriate protocol handler to fulfill the request.
Protocol handlers share a common ...