I have DCOM EXE server (the server is on different machine than clients),
which fires events to its clients. Now, my problem is when client crashes
and my server tries to fire event my server also crashes. Is there any way
my server to catch that client is dead? I want my server to continue work
even if client is dead (just without firing events).
With best regards,
Dimiter Ivanov
Out-of-Process server should not crash when the client crashes. I do not
think it is a problem of DCOM. Maybe the problem is due to the server
implementation or the system.
DCOM has the mechanism to detect the connection status (the time is around
90 seconds). It is described in the following article (search for
"timeout"):
Q171414 HOWTO: Turn Off the COM Garbage Collection Mechanism
http://support.microsoft.com/support/kb/articles/q171/4/14.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndcom/html
/msdn_dcomtec.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndcom/html
/msdn_dcomarch.asp
When the DCOM server makes a method call on an interface in the DCOM
client, the method call fails. The failure of the call indicates a DCOM
client that is not up and running, can't be launched, or is unresponsive.
In addition, we can implement asynchronous calls in Windows 2000 to notice
the failure by monitoring the response time, please check the following
link:
http://msdn.microsoft.com/library/en-us/dncomg/html/nbmc.asp
http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0599.asp
Hope it helps.
Best Regards,
Bill
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
©2001 Microsoft Corporatioin. All rights reserved.
"Bill Cheng (MS)" <billchn...@microsoft.com> wrote in message
news:2NGXHqO...@cppssbbsa01.microsoft.com...
DCOM uses an efficient pinging protocol to detect if clients are still
active. Client machines send a periodic message. DCOM considers a
connection as broken if more than three ping periods pass without the
component receiving a ping message. If the connection is broken, DCOM
decrements the reference count and releases the component if the count has
reached zero. From the point of view of the component, both the benign case
of a client disconnecting and the fatal case of a network or client machine
crash are handled by the same reference counting mechanism. Applications
can use this distributed garbage collection mechanism for free.The pinging
mechanism activates the garbage collection based on two values: the time
that should elapse between each ping message and the number of ping
messages that must be missed before the server can consider the client MIA.
Taken together, the product of these two values determines the maximum
amount of time that can elapse without a ping message being received,
before the server assumes the client is dead. By default the ping period is
set to 120 seconds; three ping messages must be missed before the client
can be presumed dead. At the present time these default values are not
user-configurable. Thus, 6 minutes (3 x 120 seconds) must elapse before a
client's references are implicitly reclaimed.
In your situation, you may consider to use IMessageFilter::MessagePending
to deduce the timeout interval so that COM can determine earlier whether
the client is active. For example, registered your own message filter. Set
a timer for 15 seconds . When the WM_TIMER message comes the
IMessageFilter::MessagePending() is called by COM. Inside the implementaion
of MessagePending(), return the code PENDINGMSG_CANCELCALL . Then the COM
cancels the call without trying again (such as firing events). Hope this
suggestion can help you.
Thanks,
Freist