18,356
社区成员
发帖
与我相关
我的任务
分享
...
nBuf=128*1024;
i=setsockopt(m_hSocket, SOL_SOCKET,SO_SNDBUF, (char*)&nBuf, sizeof(nBuf));
nBuf=128*1024;
i=setsockopt(m_hSocket, SOL_SOCKET, SO_RCVBUF, (const char*)&nBuf, sizeof(nBuf));
...
FD_SET fd = {1, m_hSocket};
TIMEVAL tv = {nSecs, 0};
if(select(0, NULL, &fd, NULL, &tv) == 0)
{
throw new CBlockingSocketException("Send timeout");
}
int nBytesSent;
if((nBytesSent = send(m_hSocket, pch, nSize, 0)) == SOCKET_ERROR)
{
throw new CBlockingSocketException("Send");
}
return nBytesSent;