18,356
社区成员
发帖
与我相关
我的任务
分享
int nSeconds;
int nLen = sizeof(nSeconds);
// 取得连接建立的时间
::getsockopt(pBuffer->sClient,
SOL_SOCKET, SO_CONNECT_TIME, (char *)&nSeconds, &nLen);
if(nSeconds != -1 && nSeconds > 5)
DWORD m_startCounter = GetTickCount();
while(GetTickCount() - m_startCounter < 5000) //5s
{
//....Processing
}
//