18,356
社区成员
发帖
与我相关
我的任务
分享
for (int k = 0; k <2; k++){
index3 = pThis->pThis->findIndex(pThis->pThis->sockNet[k], 0);
pThis->pThis->createReport((char*)setSemophoreStr, length, report, item, 9, reportLength, devAddr, k, true);
if (pThis->pThis->sockNetEnable[k] == true){
eInfo = pThis->pThis->Send(pThis->pThis->pSocketContext, pThis->pThis->pNewIOContextSend, pThis->pThis->pIoContextForSend, pThis->pThis->sockNet[k], report, 0, reportLength, 0, index3);
}
}
if (pThis->pThis->sockIndex == 0){
pThis->pThis->sockNet[0] = pIoContext->m_sockAccept;
pThis->pThis->sockNetEnable[0] = true;
memcpy(pThis->pThis->serialNoNet[0], pThis->pThis->ReportData[threadNo].serialNo, 16);
index3 = pThis->pThis->findIndex(pThis->pThis->sockNet[0], 0);
pThis->pThis->sockIndex++;
}
else{
if (pIoContext->m_sockAccept != pThis->pThis->sockNet[0]){
pThis->pThis->sockNet[1] = pIoContext->m_sockAccept;
pThis->pThis->sockNetEnable[1] = true;
memcpy(pThis->pThis->serialNoNet[1], pThis->pThis->ReportData[threadNo].serialNo, 16);
index3 = pThis->pThis->findIndex(pThis->pThis->sockNet[1], 0);
}
}
result = WSASend(socket, &(DataBuf), 1, &SendBytes, 0, &pIoContextSend->m_Overlapped, NULL);