Skip to content

Commit 5cfd4c4

Browse files
committed
modify:release time task does not to notify user
1 parent bdeb42b commit 5cfd4c4

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

XEngine_Source/XEngine_MQServiceApp/MQService_TCPTask.cpp

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -400,31 +400,36 @@ BOOL MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCTSTR lpszC
400400
}
401401
//是否需要通知
402402
int nListCount = 0;
403-
XENGINE_DBUSERKEY** ppSt_ListUser;
404-
if (DBModule_MQUser_KeyList(NULL, st_MQProtocol.tszMQKey, &ppSt_ListUser, &nListCount))
403+
if (0 == st_MQProtocol.nPubTime)
405404
{
406-
int nTCPLen = 0;
407-
TCHAR tszTCPBuffer[4096];
408-
memset(tszTCPBuffer, '\0', sizeof(tszTCPBuffer));
409-
410-
pSt_ProtocolHdr->unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_MSGNOTIFY;
411-
ProtocolModule_Packet_Common(nNetType, pSt_ProtocolHdr, &st_MQProtocol, tszTCPBuffer, &nTCPLen, lpszMsgBuffer + sizeof(XENGINE_PROTOCOL_XMQ), nMsgLen - sizeof(XENGINE_PROTOCOL_XMQ));
412-
for (int i = 0; i < nListCount; i++)
405+
//定时任务不通知
406+
XENGINE_DBUSERKEY** ppSt_ListUser;
407+
if (DBModule_MQUser_KeyList(NULL, st_MQProtocol.tszMQKey, &ppSt_ListUser, &nListCount))
413408
{
414-
//跳过自己
415-
if (0 == _tcsncmp(tszUserName, ppSt_ListUser[i]->tszUserName, _tcslen(tszUserName)))
409+
int nTCPLen = 0;
410+
TCHAR tszTCPBuffer[4096];
411+
memset(tszTCPBuffer, '\0', sizeof(tszTCPBuffer));
412+
413+
pSt_ProtocolHdr->unOperatorCode = XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_MSGNOTIFY;
414+
ProtocolModule_Packet_Common(nNetType, pSt_ProtocolHdr, &st_MQProtocol, tszTCPBuffer, &nTCPLen, lpszMsgBuffer + sizeof(XENGINE_PROTOCOL_XMQ), nMsgLen - sizeof(XENGINE_PROTOCOL_XMQ));
415+
for (int i = 0; i < nListCount; i++)
416416
{
417-
continue;
417+
//跳过自己
418+
if (0 == _tcsncmp(tszUserName, ppSt_ListUser[i]->tszUserName, _tcslen(tszUserName)))
419+
{
420+
continue;
421+
}
422+
TCHAR tszUserAddr[128];
423+
memset(tszUserAddr, '\0', sizeof(tszUserAddr));
424+
425+
SessionModule_Client_GetAddr(ppSt_ListUser[i]->tszUserName, tszUserAddr);
426+
XEngine_MQXService_Send(tszUserAddr, tszTCPBuffer, nTCPLen, nNetType);
418427
}
419-
TCHAR tszUserAddr[128];
420-
memset(tszUserAddr, '\0', sizeof(tszUserAddr));
421-
422-
SessionModule_Client_GetAddr(ppSt_ListUser[i]->tszUserName, tszUserAddr);
423-
XEngine_MQXService_Send(tszUserAddr, tszTCPBuffer, nTCPLen, nNetType);
428+
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListUser, nListCount);
424429
}
425-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListUser, nListCount);
426430
}
427431
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _T("%s消息端:%s,主题:%s,序列:%lld,投递数据到消息队列成功,通知客户端个数:%d"), lpszClientType, lpszClientAddr, st_DBQueue.tszQueueName, st_DBQueue.nQueueSerial, nListCount);
432+
428433
}
429434
else if (XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQGET == pSt_ProtocolHdr->unOperatorCode)
430435
{

0 commit comments

Comments
 (0)