Skip to content

Commit 26094b8

Browse files
committed
added:update limit speed test
1 parent 4fdd382 commit 26094b8

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

XEngine_Source/StorageModule_Session/Session_Stroage/Session_UPStroage.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,19 @@ BOOL CSession_UPStroage::Session_UPStorage_GetAll(SESSION_STORAGEINFO*** pppSt_S
341341
{
342342
Session_IsErrorOccur = FALSE;
343343

344-
if ((NULL == pppSt_StorageInfo) || (NULL == pInt_ListCount))
344+
if (NULL == pInt_ListCount)
345345
{
346346
Session_IsErrorOccur = TRUE;
347347
Session_dwErrorCode = ERROR_STORAGE_MODULE_SESSION_PARAMENT;
348348
return FALSE;
349349
}
350350

351+
if (NULL == pppSt_StorageInfo)
352+
{
353+
*pInt_ListCount = stl_MapStroage.size();
354+
return TRUE;
355+
}
356+
351357
st_Locker.lock_shared();
352358
*pInt_ListCount = stl_MapStroage.size();
353359
BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_StorageInfo, *pInt_ListCount, sizeof(SESSION_STORAGEINFO));

XEngine_Source/XEngine_StorageApp/StorageApp_Network.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ void CALLBACK XEngine_Callback_UPLoaderRecv(LPCTSTR lpszClientAddr, SOCKET hSock
3838
return;
3939
}
4040
SocketOpt_HeartBeat_ActiveAddrEx(xhHBUPLoader, lpszClientAddr);
41+
42+
#ifdef _DEBUG
43+
int nTimeWait = 0;
44+
int nCount = 0;
45+
Session_UPStorage_GetAll(NULL, &nCount);
46+
Algorithm_Calculation_SleepFlow(&nTimeWait, st_ServiceCfg.st_XLimit.nMaxUPLoader, nCount, nMsgLen);
47+
std::this_thread::sleep_for(std::chrono::microseconds(nTimeWait));
48+
#endif
4149
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_DEBUG, _T("上传客户端:%s,投递包成功,大小:%d"), lpszClientAddr, nMsgLen);
4250
}
4351
void CALLBACK XEngine_Callback_UPLoaderLeave(LPCTSTR lpszClientAddr, SOCKET hSocket, LPVOID lParam)

0 commit comments

Comments
 (0)