Originally posted by Andrew Monkhouse:
For the purposes of this test, I have set the lease value to 10 seconds. I recommend against doing this in your real assignment or in the real world.
Are you allowed to set this value in the assignment? I've got Unreferenced to work, but using the default value (whatever that is?) it doesn't seem to get called (unless its a very long time). How did everyone else implement the lease value for Unreferenced?
1. if the client haven't accomplish the startClient function and died(i mean the client machine crash.suppose the server is running on another machine).so ,what will happend to the server?
2. if the client accomplish the startClient but unaccomplish the run function and died.also,what will happend to the server?
3. under the above two circs,would the server side's unreferenced function still be calld?why?
Once line 6 has executed, the client has a reference to an instance of MyServer. If ever the client releases that reference (explicitly sets the variable server to null, or exits, or crashes) then Unreferenced will be called the next time the distributed garbage collector runs following the lease expiring.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton