Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Remoting - Retrieving a server pre-created object on the client

Remoting - Retrieving a server pre-created object on the client

Scheduled Pinned Locked Moved C#
sysadminquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shy Agam
    wrote on last edited by
    #1

    Hello experts, I'm using the System.Runtime.Remoting.Channels.Ipc namespace, and other remoting-related classes to communicate between instances of my app. I have registered a class using the RemotingConfiguration.RegisterWellKnownServiceType() method, specifying WellKnownObjectMode.Singleton. AFAIK, normally, the server automatically creates an instance of the object when the first request for the object is made, and for any request which follows, only returns references to it. What I would like to do, is to be able to create the first instance myself, and have the clients requesting the object receive the reference to MY object. Is it possible? How? Hope I made myself clear enough... :) Thanks in advance, Shy.

    S M 2 Replies Last reply
    0
    • S Shy Agam

      Hello experts, I'm using the System.Runtime.Remoting.Channels.Ipc namespace, and other remoting-related classes to communicate between instances of my app. I have registered a class using the RemotingConfiguration.RegisterWellKnownServiceType() method, specifying WellKnownObjectMode.Singleton. AFAIK, normally, the server automatically creates an instance of the object when the first request for the object is made, and for any request which follows, only returns references to it. What I would like to do, is to be able to create the first instance myself, and have the clients requesting the object receive the reference to MY object. Is it possible? How? Hope I made myself clear enough... :) Thanks in advance, Shy.

      S Offline
      S Offline
      Shy Agam
      wrote on last edited by
      #2

      Maybe if the application creating the server would also create a temporary client which would instantiate the first instance of the class?

      1 Reply Last reply
      0
      • S Shy Agam

        Hello experts, I'm using the System.Runtime.Remoting.Channels.Ipc namespace, and other remoting-related classes to communicate between instances of my app. I have registered a class using the RemotingConfiguration.RegisterWellKnownServiceType() method, specifying WellKnownObjectMode.Singleton. AFAIK, normally, the server automatically creates an instance of the object when the first request for the object is made, and for any request which follows, only returns references to it. What I would like to do, is to be able to create the first instance myself, and have the clients requesting the object receive the reference to MY object. Is it possible? How? Hope I made myself clear enough... :) Thanks in advance, Shy.

        M Offline
        M Offline
        mav northwind
        wrote on last edited by
        #3

        Hello! The RemotingServices.Marshal() method does exactly this - it publishes a given instance of an object as remoting server.

        Regards, mav -- Black holes are the places where God divided by 0...

        S 1 Reply Last reply
        0
        • M mav northwind

          Hello! The RemotingServices.Marshal() method does exactly this - it publishes a given instance of an object as remoting server.

          Regards, mav -- Black holes are the places where God divided by 0...

          S Offline
          S Offline
          Shy Agam
          wrote on last edited by
          #4

          Thanks a bunch! Greatly appreciated! Wow... there are times I tell myself "Microsoft are really f***ed-up for not having an implementation for this and that in the .NET framework." But then there are times I think the .NET framework contains everything a programmer needs... :) Regards, Shy.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups