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

Dot Remoting - Server Activated, SingleCall Technique

, 11 Jan 2011
Shows how you can create remote objects and access it from client. Here, it is server activated single call technique
RemotingEx01.zip
ConServer
ConServer
bin
Debug
ConServer.exe
ConServer.vshost.exe
ClassDiagram1.cd
Properties
RemClient
RemClient
bin
Debug
ConServer.exe
RemClient.exe
RemClient.vshost.exe
Properties
Settings.settings
using System;
using System.Collections.Generic;
using System.Text;
//Remote_003: Include the Namespace
using System.Runtime;

namespace ConServer
{
    //RemoteServer_004: Make the class Remotable by inheritance.
    public class RemCustomer : System.MarshalByRefObject 
    {
        //RemoteServer_005: Feilds on the remote Class
        private string CustName;
        private int CustId;

        //RemoteServer_014: Instance for LastTrans declared
        private LastTrans trans;

        //RemoteServer_006: Constructor for the Remote Object
        public RemCustomer()
        {
            CustName = "Ram Gopal";
            CustId = 1235;
            Console.WriteLine("Instance of Remote object Created...");

            //RemoteServer_015: Instance for LastTrans created
            trans = new LastTrans();
            Console.WriteLine("Instance of Last Transaction object created. ");
        }

        //RemoteServer_007: Get the Customer id
        public int Get_id()
        {
            Console.WriteLine("Customer Id requested...");
            return CustId;
        }

        //RemoteServer_008: Get the Customer Name
        public string Get_Name()
        {
            Console.WriteLine("Customer Name requested...");
            return CustName;
        }

        //RemoteServer_017: Instance for LastTrans declared
        public LastTrans GetLastTrans()
        {
            Console.WriteLine("Transaction object requested...");
            return trans;
        }
    }
}

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Sivaraman Dhamodharan
Software Developer iSOFT
India India
I am working as software engineer in iSOFT R&D. I have been come accross C++,MFC, .net technologies. I do like playing video games, reading books.
 

Web: www.mstecharticles.com


| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 12 Jan 2011
Article Copyright 2011 by Sivaraman Dhamodharan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid