@@ -39,8 +39,8 @@ Communicate :: ~Communicate()
3939{
4040}
4141
42- int Communicate :: Send(const nodeid_t iNodeID , const NodeInfo & oNodeInfo ,
43- const std::string & sMessage , const int iSendType)
42+ int Communicate :: Send(const int iGroupIdx , const nodeid_t iNodeID ,
43+ const NodeInfo & oNodeInfo, const std::string & sMessage , const int iSendType)
4444{
4545 if ((int )sMessage .size () > MAX_VALUE_SIZE)
4646 {
@@ -55,44 +55,44 @@ int Communicate :: Send(const nodeid_t iNodeID, const NodeInfo & oNodeInfo,
5555 if (sMessage .size () > m_iUDPMaxSize || iSendType == Message_SendType_TCP)
5656 {
5757 BP->GetNetworkBP ()->SendTcp (sMessage );
58- return m_poNetwork->SendMessageTCP (oNodeInfo.GetIP (), oNodeInfo.GetPort (), sMessage );
58+ return m_poNetwork->SendMessageTCP (iGroupIdx, oNodeInfo.GetIP (), oNodeInfo.GetPort (), sMessage );
5959 }
6060 else
6161 {
6262 BP->GetNetworkBP ()->SendUdp (sMessage );
63- return m_poNetwork->SendMessageUDP (oNodeInfo.GetIP (), oNodeInfo.GetPort (), sMessage );
63+ return m_poNetwork->SendMessageUDP (iGroupIdx, oNodeInfo.GetIP (), oNodeInfo.GetPort (), sMessage );
6464 }
6565}
6666
67- int Communicate :: SendMessage(const nodeid_t iSendtoNodeID, const std::string & sMessage , const int iSendType)
67+ int Communicate :: SendMessage(const int iGroupIdx, const nodeid_t iSendtoNodeID, const std::string & sMessage , const int iSendType)
6868{
69- return Send (iSendtoNodeID, NodeInfo (iSendtoNodeID), sMessage , iSendType);
69+ return Send (iGroupIdx, iSendtoNodeID, NodeInfo (iSendtoNodeID), sMessage , iSendType);
7070}
7171
72- int Communicate :: BroadcastMessage(const std::string & sMessage , const int iSendType)
72+ int Communicate :: BroadcastMessage(const int iGroupIdx, const std::string & sMessage , const int iSendType)
7373{
7474 const std::set<nodeid_t > & setNodeInfo = m_poConfig->GetSystemVSM ()->GetMembershipMap ();
7575
7676 for (auto & it : setNodeInfo)
7777 {
7878 if (it != m_iMyNodeID)
7979 {
80- Send (it, NodeInfo (it), sMessage , iSendType);
80+ Send (iGroupIdx, it, NodeInfo (it), sMessage , iSendType);
8181 }
8282 }
8383
8484 return 0 ;
8585}
8686
87- int Communicate :: BroadcastMessageFollower(const std::string & sMessage , const int iSendType)
87+ int Communicate :: BroadcastMessageFollower(const int iGroupIdx, const std::string & sMessage , const int iSendType)
8888{
8989 const std::map<nodeid_t , uint64_t > & mapFollowerNodeInfo = m_poConfig->GetMyFollowerMap ();
9090
9191 for (auto & it : mapFollowerNodeInfo)
9292 {
9393 if (it.first != m_iMyNodeID)
9494 {
95- Send (it.first , NodeInfo (it.first ), sMessage , iSendType);
95+ Send (iGroupIdx, it.first , NodeInfo (it.first ), sMessage , iSendType);
9696 }
9797 }
9898
@@ -101,15 +101,15 @@ int Communicate :: BroadcastMessageFollower(const std::string & sMessage, const
101101 return 0 ;
102102}
103103
104- int Communicate :: BroadcastMessageTempNode(const std::string & sMessage , const int iSendType)
104+ int Communicate :: BroadcastMessageTempNode(const int iGroupIdx, const std::string & sMessage , const int iSendType)
105105{
106106 const std::map<nodeid_t , uint64_t > & mapTempNode = m_poConfig->GetTmpNodeMap ();
107107
108108 for (auto & it : mapTempNode)
109109 {
110110 if (it.first != m_iMyNodeID)
111111 {
112- Send (it.first , NodeInfo (it.first ), sMessage , iSendType);
112+ Send (iGroupIdx, it.first , NodeInfo (it.first ), sMessage , iSendType);
113113 }
114114 }
115115
0 commit comments