- Timestamp:
- Oct 2, 2013, 12:01:09 PM (11 years ago)
- Location:
- source/ariba
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/NodeListener.cpp
r3037 r12438 60 60 } 61 61 62 void NodeListener::onOverlayConnected(const SpoVNetID& vid) { 63 } 64 65 void NodeListener::onOverlayDisconnected(const SpoVNetID& vid){ 66 } 67 62 68 } // namespace ariba -
source/ariba/NodeListener.h
r9684 r12438 57 57 * @author Sebastian Mies <mies@tm.uka.de> 58 58 * @author Christoph Mayer <mayer@tm.uka.de> 59 * @author Mario Hock <mario.hock@student.kit.edu> 59 60 */ 60 61 class NodeListener { … … 97 98 */ 98 99 virtual void onLeaveFailed( const SpoVNetID& vid ); 100 101 /** 102 * This event method is called, when the number of neighbours gets above one. 103 * 104 * Usually this means, the node is now connected to an existing spovnet, or 105 * another node connected to this node and a "two-elemnt" spovnet just formed up. 106 * 107 * NOTE: This method can be called again, after »onOverlayDisconnected« has 108 * been called. 109 * 110 * @param vid The spovnet id 111 */ 112 virtual void onOverlayConnected( const SpoVNetID& vid ); 113 114 /** 115 * This event method is called, when the number of neighbours drops to zero. 116 * 117 * Usually this means, the note has lost connection to the spovnet, or the 118 * spovnet ceased to exist, since all other nodes are gone. 119 * 120 * NOTE: This method will only be called after »onOverlayConnected« has been 121 * called. 122 * 123 * @param vid The spovnet id 124 */ 125 virtual void onOverlayDisconnected( const SpoVNetID& vid ); 99 126 }; 100 127 -
source/ariba/overlay/BaseOverlay.cpp
r12060 r12438 795 795 796 796 BaseOverlay::BaseOverlay() : 797 started(false),state(BaseOverlayStateInvalid), 797 started(false), 798 connected(false), 799 state(BaseOverlayStateInvalid), 798 800 bc(NULL), 799 801 nodeId(NodeID::UNSPECIFIED), spovnetId(SpoVNetID::UNSPECIFIED), … … 1245 1247 } 1246 1248 1247 // TODO AKTUELL: sequence numbers 1249 // TODO XXX ----> coordinate with QUIC-efforts !! 1250 // TODO aktuell: sequence numbers 1248 1251 // TODO seqnum on fast path ? 1249 1252 ld->last_sent_seqnum.increment(); … … 1620 1623 // erase mapping 1621 1624 eraseDescriptor(ld->overlayId); 1625 1626 1627 // notify the application if this is the last link to a different node 1628 if ( connected ) 1629 { 1630 bool active_links = false; 1631 1632 // look for links that are still active 1633 foreach( LinkDescriptor* ld, links ) 1634 { 1635 if ( isLinkDirectVital(ld) ) 1636 { 1637 active_links = true; 1638 break; 1639 } 1640 } 1641 1642 if ( ! active_links ) 1643 { 1644 connected = false; 1645 1646 foreach( NodeListener* i, nodeListeners ) 1647 i->onOverlayDisconnected( spovnetId ); 1648 } 1649 } 1650 1622 1651 } 1623 1652 … … 2093 2122 sideport->onLinkUp( ld->overlayId, nodeId, ld->remoteNode, this->spovnetId ); 2094 2123 2124 2125 // notify the application if this is the first link to a different node 2126 if ( not connected ) 2127 { 2128 connected = true; 2129 2130 foreach( NodeListener* i, nodeListeners ) 2131 i->onOverlayConnected( spovnetId ); 2132 } 2133 2095 2134 return true; 2096 2135 } -
source/ariba/overlay/BaseOverlay.h
r12060 r12438 425 425 /// is the base overlay started yet 426 426 bool started; 427 428 /// »true« if we have neighbours, »false« otherwise 429 bool connected; 427 430 428 431 /// The state of the BaseOverlay
Note:
See TracChangeset
for help on using the changeset viewer.