Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / May 2005

Tip: Looking for answers? Try searching our database.

Questions about MarshalByRefObject.InitializeLifetimeService

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roy Chastain - 26 May 2005 15:55 GMT
I have done some testing and it appears that the framework does not call InitializeLifetimeService until just before returning the
object reference to the client.

I would like to use the ILease returned from InitializeLifetimeService in the server code before returning to the client.  I have
observed that a call to GetLifetimeService returns a null, so I put code in to explicitly call InitializeLifetimeService on my
newly created object.  I also put code in the override for InitializeLifetimeService to display when it was called and what the
state was.  I received two displays both with the state of Initial.  One from my explicit call and on from the framework as it was
returning to the client.

For this I would say that either
1) - I am totally messed up
   or
2) - You just can't do this

I would appreciate any understanding about this issue and/or a suggestion of a way that I can acquire and use an ILease prior to
the return to the client.
-------------------------------------------
Roy Chastain
KMSYS Worldwide, Inc.
http://www.kmsys.com
Roy Chastain - 27 May 2005 13:18 GMT
I have discovered that this is (at least one) reason that RemotingServices.Marshal exists.  Calling it in the server code forces
InitializeLifetimeService to get called and that allows the lease information to be used on the server prior to that return.

>I have done some testing and it appears that the framework does not call InitializeLifetimeService until just before returning the
>object reference to the client.
[quoted text clipped - 16 lines]
>KMSYS Worldwide, Inc.
>http://www.kmsys.com

-------------------------------------------
Roy Chastain
KMSYS Worldwide, Inc.
http://www.kmsys.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.