J
Jayme Pechan
I'm very confused about whats wrong with doing long Renewal times for the
ISponsor interface. Basically, I had been returning
TimeSpan.FromSeconds(20) from my Renewal function and all was well. I then
thought it might be a good idea to increase the lease time so I use less
overhead. As a result, I changed the Renewal function to return
TimeSpan.FromMinutes(2) instead and I thought everything was good. For some
reason, when I do this, my object disappears after 6 minutes before it calls
my Renewal function for the 3rd time. It drives me crazy. I looked all
over and can't find a max value that should be specified from this method
but it sure doesn't seem to work right when I put too long of a time in
there. Here's the function that breaks it.
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags =
SecurityPermissionFlag.Infrastructure)]
public TimeSpan Renewal(ILease lease)
{
Debug.WriteLine("***** Renewal called");
return TimeSpan.FromMinutes(2);
}
All the docs use seconds for the examples so I guess I should stick with
that but why wouldn't this work? Anyone know? I did a timer loop to check
my lease time left and it counts down from 2 minutes just fine but like I
said, eventually these ILease functions throw exceptions because the object
disappears on me. Oh and I had my SponsorTimeout as 1 minute and it freed
my object on the third iteration after 9 seconds and before it called my
Renewal function.
I'm using .NET 2.0. Is this a bug or am I missing something? Any thoughts?
Thanks, Jayme.
ISponsor interface. Basically, I had been returning
TimeSpan.FromSeconds(20) from my Renewal function and all was well. I then
thought it might be a good idea to increase the lease time so I use less
overhead. As a result, I changed the Renewal function to return
TimeSpan.FromMinutes(2) instead and I thought everything was good. For some
reason, when I do this, my object disappears after 6 minutes before it calls
my Renewal function for the 3rd time. It drives me crazy. I looked all
over and can't find a max value that should be specified from this method
but it sure doesn't seem to work right when I put too long of a time in
there. Here's the function that breaks it.
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags =
SecurityPermissionFlag.Infrastructure)]
public TimeSpan Renewal(ILease lease)
{
Debug.WriteLine("***** Renewal called");
return TimeSpan.FromMinutes(2);
}
All the docs use seconds for the examples so I guess I should stick with
that but why wouldn't this work? Anyone know? I did a timer loop to check
my lease time left and it counts down from 2 minutes just fine but like I
said, eventually these ILease functions throw exceptions because the object
disappears on me. Oh and I had my SponsorTimeout as 1 minute and it freed
my object on the third iteration after 9 seconds and before it called my
Renewal function.
I'm using .NET 2.0. Is this a bug or am I missing something? Any thoughts?
Thanks, Jayme.