18,356
社区成员
发帖
与我相关
我的任务
分享
int nSent = 0;
int nBufferSize = 你的缓存区大小;
LPBYTE lpBase = 你的缓存区首指针
while( nSent < nBufferSize )
{
int nRet = ::send( SOCKET, (LPBYTE)(lpBase +nSent), nBufferSize - nSent, 0);
if( nRet == SOCKET_ERROR )
{
if( WSAGetLastError() == WSAEWOULDBLOCK )
continue;
else break;
}
nSent += nRet;
}