MCPcopy Create free account
hub / github.com/Tencent/phxpaxos / OnReceiveMessage

Method OnReceiveMessage

src/node/pnode.cpp:374–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374int PNode :: OnReceiveMessage(const char * pcMessage, const int iMessageLen)
375{
376 if (pcMessage == nullptr || iMessageLen <= 0)
377 {
378 PLErr("Message size %d to small, not valid.", iMessageLen);
379 return -2;
380 }
381
382 int iGroupIdx = -1;
383
384 memcpy(&iGroupIdx, pcMessage, GROUPIDXLEN);
385
386 if (!CheckGroupID(iGroupIdx))
387 {
388 PLErr("Message groupid %d wrong, groupsize %zu", iGroupIdx, m_vecGroupList.size());
389 return Paxos_GroupIdxWrong;
390 }
391
392 return m_vecGroupList[iGroupIdx]->GetInstance()->OnReceiveMessage(pcMessage, iMessageLen);
393}
394
395void PNode :: AddStateMachine(StateMachine * poSM)
396{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected