Re: Remote object with arguments?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Mark,

Server-activated objects require a default constructor.

"Server Activation" (.NET Remoting)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconServerActivation.asp

If you must use a constructor on the client then you'll need a
client-activated object. Singleton, however, is not client-activated.

"Client Activation" (.NET Remoting)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconclientactivation.asp?frame=true

It's also possible to use dynamic publication by marshaling the object
yourself. This way you can use any constructor that you'd like when you
create the object on the server. The object becomes registered as a
Singleton, for all intensive purposes. Dynamic publication and the
application configuration file are mutually exclusive methods for registering
a Singleton. Dynamic publication is another form of server-activation:

"RemotingServices.Marshal"
http://msdn2.microsoft.com/en-us/library/b6fy37a8.aspx

--
Dave Sexton

<mkadlec99@xxxxxxxxx> wrote in message
news:1163014856.071731.257750@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Got a remoting question I was hoping someone could solve. I have an
object (UpdateFlifo) that
has two constructors, one empty, and one with arguments. I want to
expose this
object remotely, which I have done in the code below and everything
works fine.
I now want to expose this object using constructor arguements, but not
sure
how to do this, do you have any idea?


RemotingConfiguration.RegisterWellKnownServiceType (
typeof(UpdateFlifo),
"UpdateFlifo",
WellKnownObjectMode.Singleton);


Mark.



.



Relevant Pages

  • Re: Intermittent Remoting Event Callback Problem
    ... OPCEngine published component that was originally a singleton. ... requested by the client through a single-call class factory. ... to reconnect to the server and re-register the callbacks when an error ... the callback *STILL* fails. ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Basic .net remoting question
    ... In case of later proxys are created at the client side and any ... > objets and server activated objects. ... > CAO ... Single-Call and Singleton. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: COM activation models
    ... You have a big design problem - your design relies on an ... e.g. that the singleton class factory creates ... >>>>> CALLER'S PROCESS IS NOW THE SERVER PROCESS FOR THE DESIGNATED ... >> None of the two passages you quote mentions the word "client". ...
    (microsoft.public.vc.atl)
  • Re: registering to Event
    ... I had the same problem with a singleton I created on a single machine ... to link a running custom app to a running vendor app. ... with the server by passing an object belonging to the client to the ... When I wanted to raise an event to the client the server would ...
    (microsoft.public.dotnet.framework.remoting)
  • Service not available
    ... it uses VS to construct a simple server and client using a SingleCall via ... When the demo is run it works connecting to the server object, ... as instructed in the WinForm's constructor, which is to force the client to ... public class TestService: MarshalByRefObject ...
    (microsoft.public.dotnet.framework.remoting)