Networking & Remoting

The links in this section contain resources for developers interested in understanding the networking and remoting services available in the .NET Framework. Networking and remoting classes include:

Namespace Description
System.Net Provides a simple programming interface for many of the protocols used on networks today. The WebRequest and WebResponse classes form the basis of what are called pluggable protocols, an implementation of network services that enables you to develop applications that use Internet resources without worrying about the specific details of the individual protocols.
System.Net.Sockets Provides a managed implementation of the Windows Sockets (Winsock) interface for developers who need to tightly control access to the network.
System.Runtime.Remoting Provides classes and interfaces that allow developers to create and configure distributed applications.
System.Runtime.Remoting.Activation Provides classes and objects that support server and client activation of remote objects.
System.Runtime.Remoting.Channels Contains classes that support and handle channels and channel sinks, which are used as the transport medium when a client calls a method on a remote object.
System.Runtime.Remoting.Channels.Http Contains channels that use the HTTP protocol to transport messages and objects to and from remote locations. By default, the HTTP channels encode objects and method calls in SOAP format for transmission, but other encoding and decoding formatter sinks can be specified in the configuration properties of a channel.
System.Runtime.Remoting.Channels.Tcp Contains channels that use the TCP protocol to transport messages and objects to and from remote locations. By default, the TCP channels encode objects and method calls in binary format for transmission, but other encoding and decoding formatter sinks can be specified in the configuration properties of a channel.
System.Runtime.Remoting.Contexts Contains objects that define the contexts all objects reside within. A context is an ordered sequence of properties that defines an environment for the objects within it. Contexts are created during the activation process for objects that are configured to require certain automatic services such synchronization, transactions, just-in-time (JIT) activation, security, and so on. Multiple objects can live inside a context.
System.Runtime.Remoting.Lifetime Contains classes that manage the lifetime of remote objects. Traditionally, distributed garbage collection uses reference counts and pinging for control over the lifetime of objects. This works well when there are a few clients per service, but doesn't scale well when there are thousands of clients per service. The remoting lifetime service associates a lease with each service, and deletes a service when its lease time expires. The lifetime service can take on the function of a traditional distributed garbage collector, and it also adjusts well when the numbers of clients per server increases.
System.Runtime.Remoting.Messaging Contains classes used to create and remote messages. The remoting infrastructure uses messages to communicate with remote objects. Messages are used to transmit remote method calls, to activate remote objects, and to communicate information. A message object carries a set of named properties, including action identifiers, envoy information, and parameters.
System.Runtime.Remoting.Metadata Contains classes and attributes that can be used to customize generation and processing of SOAP for objects and fields. The classes of this namespace can be used to indicate the SOAPAction, type output, XML element name, and the method XML namespace URI.
System.Runtime.Remoting.Metadata.W3cXsd2001 Contains the XML Schema Definition (XSD) defined by the World Wide Web Consortium (W3C) in 2001. The XML Schema Part2: Data types specification from W3C identifies format and behavior of various data types. This namespace contains wrapper classes for the data types that conform to the W3C specification. All date and time types conform to the ISO standards specification.
System.Runtime.Remoting.MetadataServices Contains the classes used by the Soapsuds.exe command line tool and the user code to convert metadata to and from XML schema for the remoting infrastructure.
System.Runtime.Remoting.Proxies Contains classes that control and provide functionality for proxies. A proxy is a local object that is an image of a remote object. Proxies enable clients to access objects across remoting boundaries.
System.Runtime.Remoting.Services Contains service classes that provide functionality to the .NET Framework.

Networking Articles

Writing Peer-to-Peer Networked Apps with the Microsoft .NET Framework
Learn about the peer-to-peer application model, how to discover other peers, and how to query peers for information. Also covered are the System.Net namespace for the use of Internet protocols, the System.Web.Services namespace for exposing Web services, and firewall and port issues.
The .NET Show: 'Terrarium' and Peer-to-Peer
In this episode of The .NET Show, we will be talking with Lance Olson and Erik Olson, two of the developers that have spent a lot of time and energy on this project (most of it in their spare time). We will discuss with them some of the challenges they faced in building out the peer-to-peer infrastructure. Since this application actually transmits code from one machine to another, one of the most important parts of the implementation was to take full advantage of the security model of the .NET Framework so that these random code packets could be securely executed without any danger of malicious code.
BITS: Write Auto-Updating Apps with .NET and the Background Intelligent Transfer Service API
Learn how to write applications that are capable of updating themselves automatically over a network using .NET and the Background Intelligent Transfer Service API.

Remoting Articles

An Introduction to Microsoft .NET Remoting Framework
The fundamentals of the Microsoft .NET Remoting Framework are explained in this article. In addition to describing the main components that make up the .NET Remoting Framework, different scenarios in which .NET Remoting could be used to communicate with distributed objects are also discussed.
Microsoft .NET Remoting: A Technical Overview
A technical overview of the Microsoft .NET Remoting Framework is provided in this article, including examples using a TCP channel or an HTTP channel.
.NET Remoting: Design and Develop Seamless Distributed Applications for the Common Language Runtime
Get a primer on .NET Remoting with insights into the internal plumbing. Important aspects of remoting, such as channels, object lifetime management, and clients for remote objects are discussed. In addition, some practical examples are introduced.
Side-By-Side and Versioning Considerations for .NET Remoting
Learn how to ensure that distributed applications can run side-by-side using different versions of the common language runtime and how to deal with strongly named assemblies when deploying distributed applications using .NET Remoting. Also get a brief overview of the implications that versioning has on a distributed application by examining activation, method calling, and serialization in this context.
Format for .NET Remoting Configuration Files
Get a detailed description of the elements of the remoting configuration file and see how the remoting configuration can be used.
.NET Remoting Security Solution, Part 1: Microsoft.Samples.Security.SSPI Assembly
Microsoft.Samples.Security.SSPI is an assembly implementing a managed wrapper around the Windows Security Support Provider Interface (SSPI) that provides the core functionality needed to authenticate a client and server, and signs and encrypts messages sent between the two. It also provides the key functionality needed to implement a security solution across a remoting boundary.
.NET Remoting Security Solution, Part 2: Microsoft.Samples.Runtime.Remoting.Security Assembly
Learn more about a sample assembly that leverages Microsoft.Samples.Security.SSPI (discussed in part 1 of this .NET Remoting security solution) and provides a security solution specifically for Microsoft .NET Remoting.
Managing the Lifetime of Remote .NET Objects with Leasing and Sponsorship
Leasing and sponsorship is the solution for managing the lifecycle of a remote object in .NET. Each object has a lease that prevents the local garbage collector from destroying it, and most distributed applications rely upon leasing. There are several ways in which objects and clients can extend the lease, including dedicated sponsor objects. In this article, the author explains leasing, shows how to configure it, and how it relates to the various remoting activation models. He then discusses design guidelines and options, along with their impact on throughput and performance. Additionally, he introduces a helper class used to automate the management of lease sponsors.