Re: Exposed Object vs Remoting server
From: Ken Kolda (ken.kolda_at_elliemae-nospamplease.com)
Date: 12/16/04
- Next message: Ken Kolda: "Re: Exposed Object vs Remoting server"
- Previous message: news.microsoft.com: "Exposed Object vs Remoting server"
- In reply to: news.microsoft.com: "Exposed Object vs Remoting server"
- Next in thread: Rob Richardson: "Re: Exposed Object vs Remoting server"
- Reply: Rob Richardson: "Re: Exposed Object vs Remoting server"
- Reply: Rob Richardson: "Re: Exposed Object vs Remoting server"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 16 Dec 2004 11:27:22 -0800
Allow the server to access the same object which is remoted to the clients
is a frequently occurring problem in remoting. Luckily, the answer is pretty
simple. Currently, you've probably registered your remoting object using
RemotingConfiguration.RegisterWellKnownServerObject(). The problem is that
this method exposes the object anonymously, i.e. the server doesn't have a
reference to this instance.
To fix this, you do two things:
1) Declare and instantiate a named instance of your remote object.
2) Get rid of your call to RegisterWellKnownServerObject() and instead call
RemotingServices.Marshal() on your named object. This will expose the object
so it can accept client requests.
Hope that helps -
Ken
"news.microsoft.com" <xxx@xxx.com> wrote in message
news:O2uUvR54EHA.2572@tk2msftngp13.phx.gbl...
> Hello!
> I have a remoting server which exposes a Singleton object to a client.
> The client can call methods on the object without any problem.
>
> Now, I'm trying to let the client modify the exposed object.
> My question is: How would the server be able to load the exposed object
> an retrieve the value set by the client? I'm asking because there is no
> mention of the currently exposed instance of the class in the server code.
>
> Or how do I expose a named instance of an abject to my clients? (having
> a named instance would probably solve my problem)
>
> Thanks
- Next message: Ken Kolda: "Re: Exposed Object vs Remoting server"
- Previous message: news.microsoft.com: "Exposed Object vs Remoting server"
- In reply to: news.microsoft.com: "Exposed Object vs Remoting server"
- Next in thread: Rob Richardson: "Re: Exposed Object vs Remoting server"
- Reply: Rob Richardson: "Re: Exposed Object vs Remoting server"
- Reply: Rob Richardson: "Re: Exposed Object vs Remoting server"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|