一个out-proc COM服务器如何检测客户端故障?(How can an out-proc COM server detect client failure?)
假设我们有一个out-proc COM服务器和一个客户端。 客户端在服务器中调用方法并意外终止。 有没有办法让服务器检测到这种情况并中断该方法?
Say we have an out-proc COM server and a client. The client calls a method in the server and unexpectedly terminates. Is there a way for the server to detect this and interrupt the method?
最满意答案
不是没有保持活力。 如果您使用DCOM,则有内置的保持活动机制。 DCOM服务器将周期性地ping到COM客户端,如果3 ping无法应答,服务器将声明客户端“不在”并且服务器端对象可以消失。
如果它不是DCOM那么......?
Not without a keep-alive. There is a built-in keep-alive mechanism if you are using DCOM. The DCOM server will pingback to the COM client periodically, and if 3 pings go unanswered, the server declares the client "gone" and the server-side object can go away.
If it is not DCOM then...?
更多推荐
发布评论