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 / December 2004

Tip: Looking for answers? Try searching our database.

just curious /// not a problem but just wondering if someone can tell me how this works

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
M. Posseth - 25 Dec 2004 14:51 GMT
Hello ,,,,

I have just tested my client server proggy with a time test and noticed the
folowing behavior   ( tested this 2 times to be absolutely sure )

I have a client that  calls a remote singleton object in this object i have
the folowing property

' Private field to store time object instance was created.

Private ReadOnly mdteCreationTime As DateTime = Date.Now

Public ReadOnly Property dtCreationTime() As DateTime

Get

Return mdteCreationTime

End Get

End Property

when i call this property from the client it gives me the date time the
object was first created on the server ( by the first connecting client )

this is OK ,,,,, i let the server and client running   and go home next
morning when i step into the office and call the property again from the
client i get a time and date back from that day (most of the times +- 15
minutes before the call  to the server ) the client behaves as if nothing
happened i can call all methods etc etc etc

okay i know about the garabage collector in .Net etc etc etc but i am
wondering how the remoting framework can initiate itself in a previous state
,,, or is something else happening here ???

Regards

M. Posseth
Ken Kolda - 27 Dec 2004 16:31 GMT
What does your client do while its idling all night? Does it call into the
server from time to time or does it just do nothing? What it sounds like is
that the lifetime of your singleton expires. When you call into it in the
morning, the singleton is re-created. As to why the time is 15 minutes prior
to the call, I can't explain unless your client is doing something else with
the server to cause the object to be re-created.

Ken

> Hello ,,,,
>
[quoted text clipped - 34 lines]
>
>  M. Posseth
M.Posseth - 28 Dec 2004 07:58 GMT
Hi Ken ,

>As to why the time is 15 minutes prior
> to the call, I can't explain unless your client is doing something else with
> the server to cause the object to be re-created.

I just solved this mystery  :-)   ( i feel really stupid ) turned out that
the time that was shown for recreating the object was from the server but
the time i was comparing it with was from the client ......... so the answer
was ofcourse that the server and the client time were out of sync on the
client it was +- 15 minutes later as on the server )

So i guess i should read in a config file or something to hold the singleton
state   ( like nr of connected clients etc etc )

> What does your client do while its idling all night? Does it call into the
> server from time to time or does it just do nothing? What it sounds like is
[quoted text clipped - 46 lines]
> >
> >  M. Posseth
Ken Kolda - 28 Dec 2004 16:13 GMT
If you intend for your singleton to live for the entire lifetime of the
Windows service and hold state, just give it an infinite lifetime. This will
prevent the object from ever being released by the remoting infrastructure.
To do this, override the InitializeLifetimeService() method on the object
and return null.

See this article for more info:

http://msdn.microsoft.com/library/en-us/cpguide/html/cpconlifetimeleases.asp

Good luck -
Ken

> Hi Ken ,
>
[quoted text clipped - 67 lines]
> > >
> > >  M. Posseth

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.