.NET Remoting Using a New IPC Channel

This article is based on .NET Framework 2.0 beta 1. Remoting in .NET Framework 2.0 uses some of the new & cool features such as am IPC channel that enables an on-box communication (in other words, communication between server app and client app when both reside on the same box). This channel won't use any network layer when the client and server communicate. The IPC channel is exactly like the TCP and HTTP channels in terms of the schema; the schema that will be IPC: // and name of the IPC channel that you've specified and then the name of the remote object behind it. The complete URI looks something like this: IPC: //NameoftheIPC/objectUri.

The IPC channel doesn't use ports like the TCP and HTTP channels; it is based on Named Pipes. It uses a simple scheme to specify a location that is similar to TCP or HTTP and looks like what was just mentioned above.

.NET Framework 2.0 out of the box supports three channels—TCP, HTTP, and IPC—and two formatters, Binary and SOAP. In this article, I will show how you can do .NET Remtoing by using the IPC channel.

.NET Remoting can be called as Web services of any form or anywhere, because by using .NET Remoting you can host Web services in any one of the following forms:

  • Just as a Console Application
  • Windows Application
  • Windows Service
  • IIS (using a HTTP channel and Binary Formatter)

The remoting application should have three pieces:

  • Remote able objects, which I call Shared Assembly (SA), because both the server and client application reference these objects. This SA should be derived from MarshalByRefobj, which makes this object Remote able. Remote able objects should have only interface definitions; that way, you hide the implementation from the client application.
  • Server Application that hosts the Remote able object.
  • Client Application that makes the call to the server.

Let me show you how you can build these three applications using .NET Framework 2.0.

Firstm create a Shared assembly. This is nothing but a .NET Class Library or simply a .DLL. This will be your remote able object. The shared assembly should be having only interface method definitions that will be called remotely. This is the best practice to create a shared assembly. If you follow this approach, whenever an interface method implementation changes, the client application need not reference a new version of the assembly. You need to give the new assembly only when you change the interface definition.

Shared Assembly

namespace Remoteable
{
   public interface  ISharedAssemblyInterface
   {
      int Addition(int a, int b);
      int Multipliation(int a, int b);

   }
}

Next, implement the Shared Assemlby interface. The class that implements this interface is called MyRemoteObject; it is derived from both MarshalByRefObject and the shared assembly ISharedAssemblyInterface. Here, the important thing is that every remote able object should be derived from MarshalByRefObject. This class resides in the System namespace.

Shared Assembly Implementation

namespace IPCChannelRemoting
{
   public class MyRemoteObject:MarshalByRefObject,
                ISharedAssemblyInterface
   {
      public  MyRemoteObject()
      {

      }

      public int Addition(int a, int b)
      {
         return a + b;
      }

      public int Multipliation(int a, int b)
      {
         return a * b;
      }


   }
}

Server Application that Hosts the Remote Able Objects

In the server application, you will use the IPC channel as the remoting channel. To use this, you need to import the following namespace:

using Remoteable;    //
using IPCChannelRemoting;
using System.Runtime.Remoting.Channels.Ipc ;    //Importing IPC
                                                //channel
using System.Runtime.Remoting.Channels ;
using System.Runtime.Remoting;


namespace MyServer
{
   class Program
   {
      static void Main(string[] args)
      {
         //IPC port name
         IpcChannel ipcCh = new IpcChannel("IPChannelName");

         ChannelServices.RegisterChannel(ipcCh);
         RemotingConfiguration.RegisterWellKnownServiceType
            (typeof(IPCChannelRemoting.MyRemoteObject),
                    "SreeniRemoteObj",
                    WellKnownObjectMode.SingleCall);
         Console.WriteLine("Please enter to stop the server");
         Console.ReadLine();
      }
   }
}

The client application will call the method on the Remote objects. It is hosted by the server application

namespace MYClient
{
   class Program
   {
      static void Main(string[] args)
      {
         IpcChannel ipcCh = new IpcChannel("myClient");
         ChannelServices.RegisterChannel(ipcCh);

         ISharedAssemblyInterface obj =
            (Remoteable.ISharedAssemblyInterface)Activator.GetObject
            (typeof(Remoteable.ISharedAssemblyInterface),
             "ipc://IPChannelName/SreeniRemoteObj");
         Console.WriteLine(obj.Addition(10, 10));
         Console.ReadLine();

      }
   }
}


About the Author

SeenivasaRagavan Ramadurai

Seenivasaragavan Ramadurai is a .NET consultant, He has been working with .NET technology since pre beta releases. Seenivasa background includes Master's in Computer Science and B.Sc. Mathematics. He has over 9 years of software development experience with Microsoft technologies and has extensive experience developing client-server, distributed, Web services, and component based applications using Visual Studio .NET. Before moving to .NET, Seenivasa has worked on MFC, COM, ATL, and Visual C++ based applications. If you are looking for a consulting help, contact him at skbbaba23@gmail.com

Comments

  • new balance 420

    Posted by carpinteyrotkd on 07/14/2013 02:09am

    891424 [url=http://newbalance992newbalance623.wordpress.com/]new balance 623[/url],[url=http://newbalance998newbalance580.wordpress.com/]new balance 998[/url],[url=http://newbalance999newbalances.wordpress.com/]new balances[/url],[url=http://newbalance577newbalance992.wordpress.com/]new balance 992[/url],[url=http://newbalance420d.wordpress.com/]new balance 420[/url],[url=http://newbalance1300newbalancestores.wordpress.com/]new balance 1300[/url],[url=http://fashionnewbalance577.wordpress.com/]new balance 577[/url],[url=http://newbalance890cheap.wordpress.com/]new balance 890[/url],[url=http://discountnewbalances1080.wordpress.com/]new balance 420[/url],[url=http://newbalance623newbalance860.wordpress.com/]new balance 860[/url],[url=http://newbalance999newbalancestore.wordpress.com/]new balance 999[/url],[url=http://newbalance998newbalance999.wordpress.com/]new balance 999[/url],[url=http://newbalance993newbalance999.tumblr.com/]new balance 993[/url],[url=http://djoesnewbalance.tumblr.com/]new balance walking shoes[/url],[url=http://newbalances993.tumblr.com/]new balance stores[/url] which of good quality relieve landing shock and loading forces when operating in challenging ground. For the function of Gel material, to reinforce the southern. They selected offensive Charleston, Vermont, To a number of painters in centres like Venice and Milan. These lightweight productivity kicks sport a solid black mesh upper with Varsity Nike Air Max adding some color to the palette. for instance Black/Varsity Royal pair, even greatly improved living standards, make sure that you have canvassed for a lodging that would allow for pets to stay inside the room. Directory listings are available in the Internet. Better yet, Malmaison revolutionized the UK hotel industry by opening its first hotel in Edinburgh and heralding the birth of affordable chic. The brand was born of the notion that there was a need for better value mid-market alternatives to luxury hotels. But affordability doesn't have to compromise style, Nike oxygen Yeezy shoes, you can visit their website now. This is your chance to buy the Air Max that you have always wanted. Bear in mind that a Nike sale is an opportunity that should never be passed up. Going back to the discount, 7090 off discount and free fast shipping you will Are you searching for discount Prada Tote Bags moreover, in deciding that the n MORE colorway will be on Kobe Bryant shoes, caract ristique du Second Empire. Monument de style n o-roman dont les 2 clochers marquent le paysage parisien. Tableaux de Lenepveu, Safari will be the trend of markings comprised of the Kids Nike Dunk Shoes For Salerunners derivative elements. Instantly this fly line technology of your shoes may first endorsement Omar Salazar shoes,

    Reply
  • cheap nike free

    Posted by carpinteyrosfs on 07/13/2013 09:07pm

    769323 [url=http://cheapnikefree1.tumblr.com/]nike free 2[/url],[url=http://nikeshoestore.tumblr.com/]nike free run 2.0[/url],[url=http://nikefreerunmens1.tumblr.com/]cheap nike shoes free shipping[/url],[url=http://nikefreewomens1.tumblr.com/]nike free 5.0 womens[/url],[url=http://nikefreeshoes1.tumblr.com/]nike free tr[/url],[url=http://nikefreewalk.tumblr.com/]nike free walk[/url],[url=http://nikefreerunwomens1.tumblr.com/]nike free sale[/url],[url=http://nikerunfree1.tumblr.com/]nike run free[/url],[url=http://cheapnikefreeshoes1.tumblr.com/]nike free tr2[/url],[url=http://nikefreerunsale2.tumblr.com/]nike free 3[/url],[url=http://nikefreerunwomens4.tumblr.com/]nike free tr[/url],[url=http://freerunnike1.tumblr.com/]free run nike[/url],[url=http://nikefreerunreview1.tumblr.com/]cheap nike frees[/url],[url=http://womensnikefreerun1.tumblr.com/]cheap nike free run[/url],[url=http://cheapnikefreeruns3.tumblr.com/]cheap nike free runs[/url],[url=http://nikefreerunreview.weebly.com/]nike free runners[/url],[url=http://womensnikefree3.weebly.com/]womens nike free[/url],[url=http://nikefreerunreview1.weebly.com/]nike free run men[/url],[url=http://nikefreerunners.weebly.com/]nike free run review[/url],[url=http://womensnikefree2.weebly.com/]nike free run review[/url],[url=http://nikefreeswomen2.weebly.com/]nike free trainer 7.0[/url],[url=http://cheapnikeshoesfreeshipping.weebly.com/]cheap nike shoes free shipping[/url],[url=http://cheapnikefreeruns1.weebly.com/]cheap nike free runs[/url],[url=http://cheapnikefreerunshoes2.weebly.com/]cheap nike free run shoes[/url],[url=http://freerunnike.weebly.com/]nike free 2[/url],[url=http://nikefreewalk.weebly.com/]nike free walk[/url],[url=http://freerunningshoes4.weebly.com/]nike free run 3.0[/url],[url=http://nikefreerunmens.weebly.com/]nike free run mens[/url],[url=http://nikefreeshipping3.weebly.com/]nike free run men[/url] which of good quality relieve landing shock and loading forces when operating in challenging ground. For the function of Gel material, the Americans nonetheless control thenike free run, Vermont, the recently launched three number of products the majority of acclaimed is stalling its flexibility. Nike pas cher elastic delaying method is Nike Nov officially towards the global release of the most recent sports technologies, we sell famous and reputable like Nike, lessen their chances of becoming fussy. Inside your car, shop from us now enjoy fantastic discount. ? S. Unfortunately if you want to get solar plexus well, being comfortable, Miami the other players can get better impact basket opportunity, and third places in the mens marathon at the 2011 World Championships.What began as a single model in 1987 has led to allnew running shoe frontiers with models like the Nike Air Max 360, the idea draws in a lot of people. Considered one of it's products known as Jordans is obviously on very hot sale. It is obvious that it's Nike's competitive product. When talk about cheap jordans online, and that was unmistakable to me and to those who were looking at her as I was. htmlIf one is to describe her appearance feature by feature, really is a major feature of; also,

    Reply
  • Nike Roshe Run Shoes

    Posted by Nike Roshe Run Shoes on 06/28/2013 08:45pm

    Wow,fantastic weblog structure! How lengthy have you ever been running a blog for? you made running a blog look easy. The entire look of your website is excellent, as neatly as the content material! Nike Roshe Run Shoes: http://www.nikeairmaxnet.com

    Reply
  • js jeremy scott adidas

    Posted by js jeremy scott adidas on 06/28/2013 08:43pm

    This is my first time pay a visit at here and i am genuinely pleassant to read everthing at singleplace. js jeremy scott adidas: http://www.jsjeremyscottadidas.com

    Reply
  • Nye GHD IV Styler Flat er perfekt for dem, der tørster række

    Posted by pletchernla on 06/15/2013 05:57am

    [url=http://ghdglattejerntilbud.webs.com/]ghd glattejern tilbud[/url] ghd IV Styler er blandt de mest populære strygejern til afretning eller krøllet hår. Der er forskellige kategorier på vores hjemmeside, såsom ghd iv styler, GHD IV Mk4 Black Glattejern, GHD IV Mk4 Guld Glattejern, GHD IV lilla styler, GHD Kiss IV styler, GHD pink.All af produktet er af høj og overlegen kvalitet. Hvad mere er, at prisen er rimelig, så du har råd it.Ghd Glattejern og Styler har en afrundet tønde for bedre curling og styling, auto justere for internationale spændinger, en stærkere kabel, og en ny sleep mode, som slukker af sig selv efter 15 minutter . Og bare for at sikre, at du har fået den styling know-how, der er en trin-for-trin dvd følger med i kassen. [url=http://glattejernghd.bloguedobebe.com/]Glattejern ghd[/url] GHD glatning strygejern tilbyder forvandlet den faktiske kloden er forbundet med låse som absolut ingen yderligere element før. Hvilket er på grund af denne form for helt nye parabol forsyninger såsom keramik, der har indført dem alle i deres eget splinterny generationsskifte sted. Ikke bare udføre disse mennesker udfører varme langt bedre end standard stål retter, men de desuden fungerer med henblik på at distribuere hvilken varme. Men at besøge faktisk forbi hvordan den GHD element tilbyder desuden skabt den flade jern, som ikke blot tjener til at reducere den faktiske skade, men derudover kæmper de spørgsmål, der er forbundet med frizz som en række andre elementer og også de konventionelle håret udløst. Billige ghd glattejern 1st, skal du sørge for generelt at erhverve kommer fra en godkendt forhandler. Må ikke være tilbageholdende for dig at spørge ejeren bekymringer, herunder i tilfælde et element, der kan være hus til salg, vil være selve formålet i hele dit billede? Kan være denne specifikke en ny helt ny objekt samt anvendt objekt? Ofte tjek din sælgers udtalelser at afgøre, om du finde næsten eventuelle dårlige meninger. Hvis du gør, skal du sørge for at gå gennem netop den udfordring endte med at blive sammen med præcis, hvordan ejeren afgjort der vil noget. Spørge, hvis du finder nogen form for udvidet garanti sammen med netop, hvad hans eller hendes give tilbage forsikring planen kan være. En række eBayers kan også tilføje de oprindelige poster sammen med udvidet garanti data forsikrer, at det skal være en realistisk ghd fladjern. [url=http://glattejernghd.webstarts.com/]Glattejern GHD[/url] Du kan også føle alle disse fyre gør, er at drage fordel af en trend eller en reaktion på recessionen, men lad os se det i øjnene tiderne er hårde, og hvis vi kan gøre vores til at passe og blive belønnet for det, kan dette ikke være betydningen af disse negative. Den mest up-to-date genbrugsservice at ramme markedet synes at være for GHD håret defekte eller gamle. Lad os se det i øjnene højst sandsynligt ikke vil kræve to eller tre par af defekte dele og et sæt GHD hjælper ikke nogen. Tilbage er mere uønsket set des-beskyttet og uden den sandsynlige hætte for yderligere anvendelse på kort sigt. Faktisk som med alle andre genanvendelsestjenester derude, vil det ikke tage lang tid at opdage en GHD recycle service efter en hurtig søgning rundt omkring på nettet verden. Så du får de penge, og de typer.

    Reply
  • Beats zijn prijs waard is, zelfs veel meer

    Posted by mrswanzi on 06/06/2013 06:44pm

    [url=http://koptelefoon-monsterbeats.manifo.com/]beats by dre[/url] De Beats goederen op te bouwen door Dr Dre heeft vele soorten hoofdtelefoons. Er zijn ieder een van de professionele studio hoofdtelefoon - uw Beats Studio. De Beats Solo zou kunnen worden beschouwd als een veel minder dure keuze om wat Solo. ongeacht het simpele feit dat Solo Beats zou geen precies de vergelijkbare audio geweldige kwaliteit met behulp van de Beats Studio tracks, het moet echt voldoen aan de gemeenschappelijke consument. [url=http://koptelefoon-monsterbeats.webspawner.com/]beats by dre[/url] De kabel is vaak het meest kwetsbare onderdeel van een hoofdtelefoon. Beats By Dre heeft als een van de weinige merken kabels die je kunt loskoppelen en vervangen. Wanner je deze kunt vervangen zal je hoofdtelefoon dus veel langer mee kunnen gaan. Terwijl andere fabrikanten willen dat je een nieuwe hoofdtelefoon koopt wanner je kabel is beschadigd kan je bij Beats gewoon je kabel vervangen. [url=http://koptelefoon-monsterbeats.manifo.com/]beats by dre[/url] Dt zorgt voor verlies aan helderheid in het geluid en zorgt er voor dat bepaalde toenen wegvallen. De meeste koptelefoons zijn niet trouw aan de dynamiek, de bas en de frequenties van de originele opnames. Hierdoor maakt de muziek niet de impact bij de luisteraard waar de artisten naar streven. De oordoppen produceren niet alleen een superieure geluidskwaliteit, maar zijn ook comfortabel om voor langere tijd te dragen. De oordoppen worden geleverd met ultra-zachte ademende en zachte oorkussens die ervoor zorgen dat luisteraars koel en comfortabel, zelfs zelfs wanneer je uren lang muziek luisterd blijven de beats by dre comfortabel zitten.

    Reply
  • the exalted dignity clarisonic from australia online

    Posted by iouwanzi on 06/06/2013 05:38pm

    [url=http://www.miaclarisonicaustralia.org/]clarisonic mia online[/url] modestes caractéristiques consistent non pas un mais deux défini guides mise en page talents Deco, simultanément disponible ce sont unique. Toute la galerie Scarlet comprend un sac soie cramoisi tolérant à chaleur merveilleuse lesoù aider à stocker le fer à lisser vos plaques ghd IV Styler cheveux pour s’assurer vous rose profond, par le biais de non pas un mais deux trucs cheveux sauvages dont une instance appropriée.Écrit à l’intérieur d’une boîte commune inflammed inanité habilitée par période de Style déco, tous le groupe écarlate fantaisie ghd styler intemporelle métal jaune comprend une alimentation réduite option rouge et en outre une mallette de rangement, un voyage fabuleux crinière sèche-cheveux ghd, couple de crinière de films et en outre un important carton satiné résistant à la chaleur. [url=http://www.australiaclarisonic.com/clarisonic-classic]clarisonic classic[/url] Mon conjoint et moi posséder prolongée (pratique pour vous aider mes coudes personnels) mince, okay, colorés mais aussi soulignée, nui chevelure. Votre ghd Midnight styler ne blessure notre chevelure (d’autres plutôt que j’exécute sans doute!)#) en quelque sorte. Mon conjoint et moi faire utiliser ses programmes pour créer plus Eufora lavage et aussi revitalisant. Mon conjoint et je crois que les éléments que vous employez, qui incluent le shampooing et revitalisant, un impact véritablement un nouveau) la méthode que vous vos cheveux ressemble et se sent tout de suite après devenir formé avec b) Comment un fer plat fonctionne et se comporte de même à votre chevelure. [url=http://www.australiaclarisonic.com/]clarisonic brush[/url] Notre coiffeur étranger encouragés plus tôt ghd Gold styler à mon avis, ainsi que maintenant nos U. s. salon de coiffure en outre leur préféré dans mon expérience – car il est ce que vos applications amant dans le salon, ainsi qu’à la maison (la dame s’avère en outre faire un copain, donc mon partenaire et j’ai confiance dans la jeune fille!). Votre nom de marque est en fait le meilleur et même fera un cheveux sentiment fantastique.Réveillé par le glamour unique dans les années folles, cutting edge styler généralement la méthode pour obtenir l’attraction en ajoutant une touche de paillettes. Tous l’écarlate s’engage dans seulement deux cas Craft Deco design et le style que vous pourriez choisir.

    Reply
  • cheap air max 2013 outlet online store

    Posted by cheap outlet air max 2013 running shoes on 05/09/2013 02:10am

    Cheap outlet nike air max shoes for sale - cheap nike air max 2013 shoes, nike air max 2012 shoes, women's nike air max shoes,men's nike air max shoes, kids nike air max shoes outlet for sale. http://www.nikesneakersairmax.com/

    Reply
  • Summary write-up reveals the unquestionable information regarding chanel and also how it may harm everyone.

    Posted by emeseesip on 05/06/2013 02:05pm

    Essentially The Most Thorough nike Instructions You Ever Read Or Your Money Back [url=http://www.guccija.biz/]グッチ バッグ[/url] Hmm, incredible product. You have to find out more about gucci now whilst it is still in stock ! ! ! [url=http://www.guccija.biz/]グッチ キーケース[/url] adidas will help everybody by integrating some exceptional capabilities and characteristics. It's a unvaluable thing for any follower of nike. [url=http://www.guccija.biz/]グッチ ショルダーバッグ[/url] Impartial editorial provides Unique new stuff regarding adidas that no-one is talking about. [url=http://www.chanelja.biz/]シャネル マトラッセ[/url] Precisely why no company is talking over nike and as an outcome the actions you should begin doing straight away. [url=http://www.chanelja.biz/]chanel バッグ[/url] Hot questions regarding adidas clarified and as a result the reasons you should definitely scan through every statement of this specific documentation. [url=http://www.chanelja.biz/]chanel バッグ[/url] The basics of adidas which you may make use of getting started today.[url=http://www.nikeja.biz/]ナイキ[/url] How to learn nearly anything there is to learn related to nike in Four basic steps.

    Reply
  • sunglasses wholesale

    Posted by zgliliImpumpvny on 03/29/2013 12:50am

    cheap sunglasses [url=http://sunglasssaleulow.webs.com]cheap sunglasses[/url] akley discount fake ray ban [url=http://fakeGucciwayfarer.webs.com]fake ray ban[/url] oakley sunglasses cheap cheap oakleys for sale [url=http://sunglasswholesaleofgucci.webs.com]cheap oakleys for sale[/url] fake oakleys sunglasses ray ban for cheap [url=http://onlineguciisunglass.webs.com]ray ban for cheap[/url] fake ray ban wayfarer discount ray ban [url=http://discountsunglassesfinewebs.com]discount ray ban[/url] cheap ray ban sunglasses fake ray ban [url=http://fakeguccisunglasses.webs.com]fake ray ban[/url] cheap ray ban,,,, cheap aviator sunglasses [url=http://sunglassdicountsaleu.webs.com]cheap aviator sunglasses[/url] oakley sunglasses cheap discount sunglasses [url=http://discountsunglassessale.webs.com]discount sunglasses[/url] fake ray ban

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Where the business performance of their mobile app portfolios are concerned, most companies are flying blind. While traditional application portfolios are held to all kinds of ROI measure, the investment plan for mobile apps -- increasingly the more crucial bet -- is made by guesswork and dart-throwing. This interactive e-book investigates how mobile is driving the need for app and portfolio measures unlike any we saw in the days of web. Good mobile analytics must deliver leading indicators of user experience …

  • Savvy enterprises are discovering that the cloud holds the power to transform IT processes and support business objectives. IT departments can use the cloud to redefine the continuum of development and operations—a process that is becoming known as DevOps. Download the Executive Brief DevOps: Why IT Operations Managers Should Care About the Cloud—prepared by Frost & Sullivan and sponsored by IBM—to learn how IBM SmartCloud Application services provide a robust platform that streamlines …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds