MCPcopy Create free account
hub / github.com/BirolLab/abyss / pumpNetwork

Method pumpNetwork

Parallel/NetworkSequenceCollection.cpp:697–728  ·  view source on GitHub ↗

Receive and dispatch packets. * @return the number of packets received */

Source from the content-addressed store, hash-verified

695 * @return the number of packets received
696 */
697size_t NetworkSequenceCollection::pumpNetwork()
698{
699 for (size_t count = 0; ; count++) {
700 int senderID;
701 APMessage msg = m_comm.checkMessage(senderID);
702 switch(msg)
703 {
704 case APM_CONTROL:
705 parseControlMessage(senderID);
706 // Deal with the control packet before we continue
707 // processing further packets.
708 return ++count;
709 case APM_BUFFERED:
710 {
711 MessagePtrVector msgs;
712 m_comm.receiveBufferedMessage(msgs);
713 for (MessagePtrVector::iterator
714 iter = msgs.begin();
715 iter != msgs.end(); iter++) {
716 // Handle each message based on its type
717 (*iter)->handle(senderID, *this);
718 // Delete the message
719 delete (*iter);
720 *iter = 0;
721 }
722 break;
723 }
724 case APM_NONE:
725 return count;
726 }
727 }
728}
729
730/** Call the observers of the specified sequence. */
731void NetworkSequenceCollection::notify(const V& key)

Callers 3

performNetworkTrimMethod · 0.45

Calls 5

checkMessageMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
handleMethod · 0.45

Tested by

no test coverage detected