diff --git a/BLEEPlib/src/mainmodules/EstimateRTTModule.cpp b/BLEEPlib/src/mainmodules/EstimateRTTModule.cpp index 740d41e4ff..c7d027be95 100644 --- a/BLEEPlib/src/mainmodules/EstimateRTTModule.cpp +++ b/BLEEPlib/src/mainmodules/EstimateRTTModule.cpp @@ -607,6 +607,10 @@ bool EstimateRTTModule::MulticastMessage(std::shared_ptr message) { int sentOut = 0; for (int i : idxs) { if (message->GetSource().GetId() != dests[i].GetId() && sentOut < fanOut) { + // check whether there exists a data socket for the destination peer + if (!peerManager.HasEstablishedDataSocket(dests[i])) + continue; + // get datasocket int socketFD = peerManager.GetConnectedSocketFD(dests[i]); std::shared_ptr dataSocket = socketManager.GetDataSocket(socketFD); @@ -667,6 +671,10 @@ bool EstimateRTTModule::ForwardMessage(std::shared_ptr int sentOut = 0; for (int i : idxs) { if (message->GetSource().GetId() != dests[i].GetId() && sentOut < fanOut){ + // check whether there exists a data socket for the destination peer + if (!peerManager.HasEstablishedDataSocket(dests[i])) + continue; + // get datasocket int socketFD = peerManager.GetConnectedSocketFD(dests[i]); std::shared_ptr dataSocket = socketManager.GetDataSocket(socketFD);