[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

.Net remoting expiration error

Stephane

9/24/2004 3:07:00 PM

Hi,

I've got a server using .Net remoting. From a web administration, I control
data contained in the server but after few minutes of inactivity, i got this
error and the objects has disapear:

System.Runtime.Remoting.RemotingException: Object
</37da65f4_aed1_48a9_978e_210706ff8213/P5J_khvuRZ_5tcLN9pbJJwoY_137.rem> has
been disconnected or does not exist at the server.

Here's my configuration file:

<configuration>
<system.runtime.remoting>
<application name="LiveSnapService">
<lifetime
leaseTime = "10M"
sponsorshipTimeOut = "10M"
renewOnCallTime = "10M"
pollTime = "10S" />
<service>
<wellknown type="LiveSnapDotNet.server.MainServer, LiveSnapDotNet"
objectUri="LiveSnapDotNet.server.MainServer"
mode="Singleton" />
</service>
<channels>
<channel ref="tcp" port="8085">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>

How can I configure it so it won't expire? Can I set values to 999999D for
example?

Thanks

Stephane
1 Answer

Sam Santiago

9/24/2004 3:31:00 PM

0

You have to override the InitializeLifetimeService method on your remote
object and return null from it:

public class MySingleton : MarshalByRefObject
{
public override object InitializeLifetimeService()
{
return null;
}
}

For more extensive discussion of leases read this article:

Managing the Lifetime of Remote .NET Objects with Leasing and
Sponsorshiphttp://msdn.microsoft.com/msdnmag/issues/03/12/LeaseMan...
lt.aspx
Thanks,
Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTe...
_______________________________
"Stephane" <Stephane@discussions.microsoft.com> wrote in message
news:97F10A89-AA3A-48F4-861B-F16952555673@microsoft.com...
> Hi,
>
> I've got a server using .Net remoting. From a web administration, I
control
> data contained in the server but after few minutes of inactivity, i got
this
> error and the objects has disapear:
>
> System.Runtime.Remoting.RemotingException: Object
> </37da65f4_aed1_48a9_978e_210706ff8213/P5J_khvuRZ_5tcLN9pbJJwoY_137.rem>
has
> been disconnected or does not exist at the server.
>
> Here's my configuration file:
>
> <configuration>
> <system.runtime.remoting>
> <application name="LiveSnapService">
> <lifetime
> leaseTime = "10M"
> sponsorshipTimeOut = "10M"
> renewOnCallTime = "10M"
> pollTime = "10S" />
> <service>
> <wellknown type="LiveSnapDotNet.server.MainServer, LiveSnapDotNet"
> objectUri="LiveSnapDotNet.server.MainServer"
> mode="Singleton" />
> </service>
> <channels>
> <channel ref="tcp" port="8085">
> <serverProviders>
> <formatter ref="binary" typeFilterLevel="Full" />
> </serverProviders>
> </channel>
> </channels>
> </application>
> </system.runtime.remoting>
> </configuration>
>
> How can I configure it so it won't expire? Can I set values to 999999D for
> example?
>
> Thanks
>
> Stephane