May 2004
Intermediate to advanced
888 pages
22h 31m
English
As previously said, if you fail to renew a lease, the remote object is removed from the remoting infrastructure and released for garbage collection.
Although this doesn’t ensure that the object will be freed immediately, it guarantees that any subsequent call to it will fail.
To illustrate this, you can modify the unit SimpleServer_Impl.pas, by commenting out the line where it renews the lease. It will look as shown below:
function TSimpleServer.Renewal(Lease: ILease): TimeSpan;
begin
writeln('Request for renewal for TSimpleServer');
// Comment the following line to prevent lease renewal
// Lease.Renew(TimeSpan.FromMinutes(LeaseDurationInMinutes));
end;Find the code on the CD: \Chapter 30\Ex03.
By doing this, the lease ...
Read now
Unlock full access