Microsoft KB Archive/271626

= DCOM IStream::Read Blocks on Connection Time Out =

Article ID: 271626

Article Last Modified on 1/29/2007

-

APPLIES TO


 * Microsoft Distributed Component Object Model 1.2
 * Microsoft Windows 95
 * Microsoft Windows 98 Standard Edition
 * 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 &quot;keepalive&quot; 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



MORE INFORMATION
For additional information about related IStream methods, click the article number below to view the article in the Microsoft Knowledge Base:

269874 DCOM IStream::Write Corrupts Data with No Error Return

For additional information about packet sizes, click the article number below to view the article in the Microsoft Knowledge Base:

183437 Description of the Internet Protocol Packet Size Setting

Additional query words: DCOM read hang network timeout

Keywords: kbdcom kbprb KB271626

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.