Cannot Change DCOM Call Timeouts in Windows NT 4.0 (255198)
The information in this article applies to:
- Microsoft Windows NT Server 4.0
This article was previously published under Q255198 SYMPTOMS
Distributed Component Object Model (DCOM) calls may take a long time to time out if the network is down, or if the server is unavailable.
CAUSE
This behavior occurs because DCOM does not give access to the underlying remote procedure call (RPC) binding handle, which makes it difficult to configure the RPC timeout.
RESOLUTION
To work around this behavior, use the following method:
When you develop code that uses DCOM on Microsoft Windows NT 4.0, Microsoft Windows 95, or Microsoft Windows 98, you can make use of multithreading to give up on a DCOM call before the default timeout. You can spawn another thread that makes the DCOM call, and have the original thread wait for the desired amount of time. The original thread can 'give up' on the spawned thread, and proceed as if the call had timed out. There are a few things to consider when implementing this solution:
- If the original thread wants to really 'forget' about the thread
that is making the DCOM call, it must close the handle to the
thread, so that when the original thread ends, the thread object is
deleted.
- The original thread might give up and proceed as if the call did not
succeed, but then network conditions might improve so that the call
does succeed. If the call modifies the state of the server, this
can be a problem. It might be possible for the background thread to
'clean up' if it has been abandoned. This type of solution is best
for calls that do not modify the state of the server.
- Even though the original thread gives up on the thread that made the
DCOM call, the thread is still running until the DCOM call times
out. This means that the process cannot end normally because it
will wait for the thread to end. You can use TerminateThread in
this situation, but it is not recommended.
Modification Type: | Major | Last Reviewed: | 8/27/2002 |
---|
Keywords: | kbprb KB255198 |
---|
|