Eric Twietmeyer
10/13/2004 10:53:00 PM
Hello,
I'm just now entering the world of .NET remoting. I've been reading Ingo
Rammer's book and am looking at the section on leases and sponsors.
I'm wondering if I can use this sponsorship idea to keep track of whether
the client app is alive. My idea is to register a sponsor with a CAO with a
renewal time of say 10 seconds (assuming initial lease time is 10 seconds).
The CAO is assumed to live for the lifetime of the client application. So
the sponsor will keep returning 10 second while the client app is running.
If the client app falls over (which in my case may unfortunately occur), the
10 second period will expire and then the server will try to contact the
sponsor, fail and then mark the CAO as Expired (I guess?).
My question is, is there some way I can tell on the server that the CAO has
expired so that the server in fact then knows that the client app itself has
died? Will the destructor of the CAO be called? I assume only during
finalization. How about IDispose if it derives from IDisposable? Will that
be called when the state changes to Expired? If not, is there some way on
the server in the CAO itself to know its Lease state has changed to Expired?
Or do I just need to poll?
Thanks,
-Eric Twietmeyer