Add LifetimeService overrides to all MarshalByRef derived classes to prevent the remoting interfaces from expiring.0.6.0-stable
parent
3646cc32c4
commit
53461fad2c
|
@ -25,6 +25,7 @@
|
|||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
using System;
|
||||
using System.Runtime.Remoting.Lifetime;
|
||||
using Axiom.Math;
|
||||
using libsecondlife;
|
||||
using Nini.Config;
|
||||
|
@ -55,6 +56,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
m_itemID = itemID;
|
||||
}
|
||||
|
||||
//
|
||||
// Never expire this object
|
||||
//
|
||||
public override Object InitializeLifetimeService()
|
||||
{
|
||||
ILease lease = (ILease)base.InitializeLifetimeService();
|
||||
|
||||
if (lease.CurrentState == LeaseState.Initial)
|
||||
{
|
||||
lease.InitialLeaseTime = TimeSpan.Zero;
|
||||
}
|
||||
return lease;
|
||||
}
|
||||
|
||||
//
|
||||
// OpenSim functions
|
||||
|
|
|
@ -40,6 +40,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
{
|
||||
private Dictionary<string,MethodInfo> inits = new Dictionary<string,MethodInfo>();
|
||||
|
||||
//
|
||||
// Never expire this object
|
||||
//
|
||||
public override Object InitializeLifetimeService()
|
||||
{
|
||||
ILease lease = (ILease)base.InitializeLifetimeService();
|
||||
|
||||
if (lease.CurrentState == LeaseState.Initial)
|
||||
{
|
||||
lease.InitialLeaseTime = TimeSpan.Zero;
|
||||
}
|
||||
return lease;
|
||||
}
|
||||
|
||||
public ScriptBaseClass()
|
||||
{
|
||||
MethodInfo[] myArrayMethodInfo = GetType().GetMethods(BindingFlags.Public|BindingFlags.Instance);
|
||||
|
|
Loading…
Reference in New Issue