Click here to Skip to main content
15,886,873 members
Articles / Programming Languages / C#

Using MSMQ for Custom Remoting Channel.

Rate me:
Please Sign up or sign in to vote.
4.88/5 (34 votes)
10 Dec 200115 min read 452.2K   3.6K   204  
This article describes how to design, implement (C#) and configure the Custom Remoting Channel using MSMQ.
//--------------------------------------------
// Written by Roman Kiss (rkiss@pathcom.com)
// December 5, 2001
// 
// History:
//			12-05-2001	RK	Initial Release	
//--------------------------------------------
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;

// using RKiss.MSMQChannelLib;		// necessary for option 1

public class Server 
{
	public static int Main(string[] args)
	{
		
		/*
		// option 1
		MSMQReceiver channel = new MSMQReceiver("msmq", @".\reqchannel", 1);
		ChannelServices.RegisterChannel(channel);

		RemotingConfiguration.RegisterWellKnownServiceType(
					Type.GetType("RemoteObject.RemObject, RemoteObject"),
					"endpoint", 
					WellKnownObjectMode.SingleCall);
		*/

		// option 2
		RemotingConfiguration.Configure(@"..\..\Server.exe.config");

		System.Console.Write("Hit <enter> to exit server...\n");
		System.Console.ReadLine();

		return 0;
	}
 }

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


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions