O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Use a Sponsor to Keep Remote Objects Alive

Problem

You want to keep a remote object alive while it’s in use, but you don’t want to be forced to periodically call the ILease.Renew method from your client.

Solution

Create and register a lease sponsor that will automatically renew the remote object.

Discussion

.NET Remoting introduces the ideas of lifetime leases and lease sponsors. A lease sponsor is remotable object that runs in the client’s application domain. It has a single purpose—to keep the remote objects your application is using alive.

The lease sponsor doesn’t interact with the remote object directly. Instead, it waits for the .NET Remoting infrastructure to initiate communication. Whenever a remote object is about to expire, .NET will contact ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required