Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » General » Downloads
 
Add your own
alternative version

Pluggable Remote Object Hosting

, 11 Nov 2003
This article presents a Pluggable mechanism for the identification and hosting of .NET Remote objects.
remoteplugins_bin.zip
remoteplugins_src.zip
RemoteHostingApp
RemoteHostingApp.prjx
RemoteHostingApp.cmbx
PluggableRemoteObjects
PluggableRemoteObjects.prjx
PluggableRemoteObjects.cmbx
RemotePluggins
RemotePluggins.prjx
RemotePluggins.cmbx
StandardRemoteObjects
StandardRemoteObjects.prjx
StandardRemoteObjects.cmbx
using System;
using System.Collections;

using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

using System.IO;

namespace Boland.Plugin
{

	class RemoteHostingApp
	{
		[STAThread]
		static void Main(string[] args)
		{
			try
			{
				Console.Write("Remote Hosting Application Started ");
				Console.Write(DateTime.Now.ToLongDateString() + ":");
				Console.WriteLine(DateTime.Now.ToLongTimeString());

				Console.WriteLine("About to deploy standard Remote Objects");
				RemotingConfiguration.Configure("RemoteHostingApp.exe.config");
				Console.WriteLine("Standard Remote Objects deployed");
				
				RemotePluginManager pluginManager =
					new RemotePluginManager();
				Console.WriteLine("About to deploy Pluggable Remote Objects");
				pluginManager.RegisterPlugins();
				Console.WriteLine("Pluggable Remote Objects deployed");

				ShowWellKnownServices();

				System.Console.Write("Hit any key to exit: ");
				System.Console.ReadLine();

				Console.Write("Remote Hosting Application Stopped ");
				Console.Write(DateTime.Now.ToLongDateString() + ":");
				Console.WriteLine(DateTime.Now.ToLongTimeString());
			}
			catch(Exception e)
			{
				Console.WriteLine(e);
			}
		}

		protected static void ShowWellKnownServices()
		{
			Console.WriteLine("--------------Well known services--------------");
			WellKnownServiceTypeEntry[] entries = 
				RemotingConfiguration.GetRegisteredWellKnownServiceTypes();
			foreach(WellKnownServiceTypeEntry entry in entries)
			{
				Console.WriteLine("Assembly: " + entry.AssemblyName);
				Console.WriteLine("Mode: " + entry.Mode);
				Console.WriteLine("URI: " + entry.ObjectUri);
				Console.WriteLine("Type: " + entry.TypeName);
			}
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

David Boland
Web Developer
United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 12 Nov 2003
Article Copyright 2003 by David Boland
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid