all groups > dotnet remoting > march 2004 >
You're in the

dotnet remoting

group:

SAO and Lifetime


Re: SAO and Lifetime Sunny
3/30/2004 9:08:51 AM
dotnet remoting:
Hi Wernfried,


In article <21jb4c.omg.ln@news.bln.sesa.de>,
wernfried.nospam.schwenkner@sesa.de says...
[quoted text, click to view]

Every MBR has the possibility to be sponsored. Lifetime management is
for all types.
But, what do you mean by your question is another thing.
The SAOs are 2 types - Singleton and Singlecall.
Singlecall mode creates a new object for every method call, I.e. you do
not have to care about lifetime, as the object will live only during the
method call.
For Singleton - this object is exposed to all clients. I.e. every client
hits only one instance. And if the lifetime of the object expires, on
next call remoting infrastructure will create a new one. Here managing
lifetime does make sense, if you wish to be sure that you are using only
one and the same object all the time, without recreating it. Here you
have 2 possibilities:
- to make the object to live forever - just override the
GetLifetimeService to return null.
- to be sure that object lives while there is any connected client -
then you soul use client side sponsors, and upon connection you have to
register clients sponsor to the object, and when client is done, to
unregister the sponsor. So, the object will live while there is any
registered sponsor.

Hope that helps
SAO and Lifetime Wernfried Schwenkner
3/30/2004 12:56:53 PM
I want a server activated object life as long as the client is
connected. Can this be done only by pinging the server from the client
or is there another (buildin) way? For CAOs there is sponsoring.
--
Sleepless in Berlin
AddThis Social Bookmark Button