|
|
microsoft.public.platformsdk.com_ole
"Ted Toal" <ttoal@sierravideo.com>
wrote in message
news:vSyp6.65$uk.80804@news.pacbell.net...
> MSDN describes keep-alive pinging done by DCOM on a per-machine basis
to
> monitor for network connection failures between machines.
However, it
does
> not say what DCOM actually does if a network failure is detected.
Does
DCOM
> automatically release the interfaces of all add-refed interfaces that
were
> opened by the remote machine whose connection failed?
>
> Also, the description implies that it is a great thing that DCOM does
> pinging on a per-machine rather than per-application basis. But
what if a
> client app crashes and shuts down, but the client machine does not?
This
> would mean that the client's open interfaces would remain open at the
> server. So, don't client apps also need to implement keep-alive
pinging?
I'm actually very familiar with this topic.
If a pointer to an interface is considered to be "dead"
i.e., the server is "dead", then any attempt to
call a method on the interface (except AddRef/Release
possibly) fails.
Secondly, if the server determines that the
client is "dead", then, at least logically,
Release is called on the interface
from the server end. You shouldn't have
to worry about reference counts.
I don't understand the second paragraph but the
answer is no, client apps don't have to implement
their own pinging.
The problem with Microsoft's implementation is
that there are only two threads per MACHINE that
ping. These threads can get blocked by "bad"
code that does something like this..
CoInitialize(NULL); // Single-threaded apartment
WaitForSingleObject(...);
If you have two or more
threads that do
this on a single machine,
pinging will fail and the
interfaces will time-out. The consequence
of this is that after six minutes, any
interface pointers to remote objects
will be considered "dead." Code that
attempts to use use these interfaces
will get RPC_E_DISCONNECTED,
etc.
And you thought it was near impossible
to hose an ENTIRE BOX with a single
process, even on Windows 2000. Not so...
There are many unsuspecting
"virus" authors out there who have
become such quite by accident.
|