What determines how long does an out of process COM server takes to notice that a client has died?

本秂侑毒 提交于 2019-12-21 17:21:56

问题


In a simple windows setup we have a COM singleton that runs as an out of process server.

Clients connect by calling cocreate and each receives an interface to the same instance of the server.

If clients shutdown normally they release their references.

The server has a bit of logic that keeps it alive for a short time after the last release to allow for new connections.

I'm interested in one special case - the server is running with only one client which crashes (consider this to be any random unknown crash) and the client exits without having released its references.

I observe that after a undefined period of time say 8 minutes the server receives release calls on the stubs of any objects that the server had returned interfaces from to the client. This appears to be an automatic cleanup that I assuming is started by the LRPC layer.

Is this documented anywhere and is the timeout configurable?

Note: Multithreaded apartment model used throughout.


回答1:


This https://web.archive.org/web/20171228092925/http://www.microsoft.com/msj/0398/dcom.aspx under DCOM Garbage Collection seems to indicate that DCOM uses a 120 second timeout which needs to be missed three times, so about 6 minutes the client will be considered disconnected. Unfortunately it also indicates that it isn't user configurable and I cannot find any stuff to the contrary.



来源:https://stackoverflow.com/questions/2328551/what-determines-how-long-does-an-out-of-process-com-server-takes-to-notice-that

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!