Programmatic Registration

In Chapter 2, you learned how to register .NET Remoting channels for a component host and a client that uses configuration files. As with most tasks in .NET, anything you can do, you can do in code.

Consider the following configuration file, which you might remember from Chapter 2. It defines a single registered SingleCall object type and a TCP/IP listening channel on port 8080.

<configuration>    <system.runtime.remoting>       <application name="SimpleServer">          <service>             <wellknown mode="SingleCall"                        type="RemoteObjects.RemoteObject, RemoteObjects"                        objectUri="RemoteObject" />          </service>          <channels>             <channel ref="tcp server" port="8080" /> ...

Get Microsoft® .NET Distributed Applications: Integrating XML Web Services and .NET Remoting now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.