Microsoft KB Archive/201213

{|
 * width="100%"|

BUG: Send Fails with Error WSAENOBUFS Over Blocking Socket

 * }

Q201213

-

The information in this article applies to:


 * Microsoft Windows NT Server version 4.0
 * Microsoft Windows NT Workstation version 4.0
 * Microsoft Windows 98
 * Microsoft Windows 95

-

SYMPTOMS
When large blocks of data (for example, 3-4 MB) are sent over a blocking socket, send eventually fails with error 10055, WSAENOBUFS.

The online documentation indicates that send over a blocking socket should block if there is no system buffer space available:

"If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in a nonblocking mode. On nonblocking stream oriented sockets, the number of bytes written can be between 1 and the requested length, depending on buffer availability on both client and server machines."

RESOLUTION
When you encounter the problem described in the "Symptoms" section, please consider using one of the following workarounds:


 * Use the socket in nonblocking or asynchronous mode.
 * Break large-size data blocks into small ones and specify a relatively small buffer in send for blocking sockets, preferably no larger than 64K.
 * Set the SO_SNDBUF socket option to 0 (zero) to allow the stack to send from your application buffer directly.

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

Additional query words:

Keywords : kbOSWinNT400bug kbSDKPlatform kbOSWin95bug kbOSWin98bug kbWinsock _IK kbGrpDSNet

Issue type : kbbug

Technology : kbWinNTsearch kbWinNTWsearch kbWinNTW400 kbWinNTW400search kbWinNT400xsearch kbWinNTSsearch kbWinNTS400xsearch kbWinNTS400 kbWin95search kbWin98search kbZNotKeyword3 kbWin98