9.2. A Remotable Object

This chapter discusses two methods of hosting remote objects. The first method is Windows Services, which are background processes that lack a user interface. They are started either manually or automatically when Windows first loads. They are ideal for hosting remote objects because they do not interfere with other users on the machine. All interaction with services is done through the Service Control Manager (SCM), as shown in Figure 9-1. This program is run from the Administrative Tools directory in the Control Panel and is simply called "Services." Typically, Windows Services can be started, stopped, and paused from within the SCM. When these actions occur, a corresponding method within the service is called, allowing reciprocating action to occur.

Figure 9-1. Service Control Manager

The second method involves the use of an Internet Information Server (IIS) to host remotable objects. The advantages of this method are that no code is required and it only takes a few moments to configure. However, the configuration options are limited, compared to what can be done with a Windows Service, and the only available channel is HttpChannel. Windows Services can also use TcpChannel, which is considerably faster.

A remotable object is an essential ingredient for hosting a remote object. Example 9-1 contains a remotable version of the ServerInfo class from ...

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.