【发布时间】:2010-04-18 13:02:56
【问题描述】:
我有一个作为单身人士的远程处理类
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown
mode="Singleton"
type="PTSSLinkClasses.PTSSLinkClientDesktopRemotable, PTSSLinkClasses"
objectUri="PTSSLinkDesktop" />
</service>
<channels>
<channel ref="http" port="8901"/>
</channels>
</application>
</system.runtime.remoting>
</configuration>
它是在“服务器”服务中创建的。 另一个客户端服务使用这个远程对象。 客户端使用计时器(轮询)(用于测试)每 0.5 秒调用一次远程对象
如果服务器服务停止,远程对象不可用,客户端服务的内存使用量不断增加......
我已经覆盖 InitialLifetimeService 以返回 null
public override Object InitializeLifetimeService()
{
return null;
}
如果远程对象不可用,.net 是否会将该对象的所有调用请求排队???直到所有的内存都用完? 如何检测远程对象不可用并停止尝试调用远程方法?
【问题讨论】:
标签: c# .net remoting .net-remoting