DCOM IStream::Read() Blocks on Connection Time Out (271626)
The information in this article applies to:
- Microsoft Distributed Component Object Model (DCOM) 1.2
- Microsoft Windows 95
- Microsoft Windows 98
- Microsoft Windows 98 Second Edition
- Microsoft Windows Millennium Edition
This article was previously published under Q271626 SYMPTOMS
The Component Object Model (COM) IStream::Read method may seem to stop responding (hang) if a TCP connection time out occurs.
This situation can occur if the network is disrupted, or if transmissions are delayed long enough to cause the server to drop the connection.
CAUSE
If the server does not receives acknowledgements (ACKS) for sent packets, it eventually drops the connection. The client never returns from the underlying socket read, because there is no time-out option set and the client never sees further traffic from the server.
To hide network interface details, DCOM uses the Remote Procedure Call (RPC) technology. This, in turn, uses Windows Sockets (Winsock) to abstract session handling. Unlike Microsoft Windows 2000, the RPC implementation in the Windows versions listed above do not include "keepalive" capabilities. Additionally, unlike Microsoft Windows NT and Windows 2000, the RPC RpcCancelThread and RpcCancelThreadEx functions are not implemented.
It is not feasible to add keepalive or call cancel functionality to the RPC implementation on the listed Windows versions without compromising reliability and stability.
RESOLUTION
Microsoft recommends having the IStream methods read data in less than 4-KB blocks. Although this cannot guarantee a total resolution for the problem, it substantially decreases the window of vulnerability.
On Ethernet, the maximum data buffer size that will keep the TCP layer from dividing the buffer into multiple packets is 1,408 bytes. This value takes the DCOM configuration selections for Authentication, Impersonation, and Security into account (see the Default Properties tab in the Dcomcnfg utility).
You can verify the following packet information by using the Microsoft Network Monitor tool.
Size Offset
Packet Field (dec) (hex)
--------------------------
Ether header: 14 x0000
ip header: 20 x000E
tcp header: 20 x0022
RPC header: 44 x0036
Payload: 1408 x0062
Trailer: 8 x05E2
Modification Type: | Minor | Last Reviewed: | 12/17/2004 |
---|
Keywords: | kbDCOM kbprb KB271626 |
---|
|