Changeset 3056 for sample/pingpong/PingPong.cpp
- Timestamp:
- Apr 23, 2009, 6:58:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sample/pingpong/PingPong.cpp
r3055 r3056 13 13 14 14 // the service that the pingpong wants to use 15 ServiceID PingPong::PINGPONG_ ID = ServiceID( 111 );15 ServiceID PingPong::PINGPONG_SERVICEID = ServiceID( 111 ); 16 16 17 17 // construction … … 63 63 64 64 // bind communication and node listener 65 node->bind( this ); /*NodeListener*/66 node->bind( this, PingPong::PINGPONG_ ID); /*CommunicationListener*/65 node->bind( this ); /*NodeListener*/ 66 node->bind( this, PingPong::PINGPONG_SERVICEID); /*CommunicationListener*/ 67 67 68 68 // start node module … … 88 88 89 89 // unbind communication and node listener 90 node->unbind( this ); /*NodeListener*/91 node->unbind( this, PingPong::PINGPONG_ ID ); /*CommunicationListener*/90 node->unbind( this ); /*NodeListener*/ 91 node->unbind( this, PingPong::PINGPONG_SERVICEID ); /*CommunicationListener*/ 92 92 93 93 // leave spovnet … … 121 121 vector<NodeID> nodes = node->getNeighborNodes(); 122 122 BOOST_FOREACH( NodeID nid, nodes ){ 123 node->sendMessage( pingmsg, nid, PingPong::PINGPONG_ ID );123 node->sendMessage( pingmsg, nid, PingPong::PINGPONG_SERVICEID ); 124 124 } 125 125 … … 128 128 // internally, gets all neighboring nodes and sends the message 129 129 //----------------------------------------------------------------------- 130 // node->sendBroadcastMessage( pingmsg, PingPong::PINGPONG_ ID );130 // node->sendBroadcastMessage( pingmsg, PingPong::PINGPONG_SERVICEID ); 131 131 } 132 132 133 // node listener interface134 133 void PingPong::onJoinCompleted( const SpoVNetID& vid ) { 135 134 logging_info( "pingpong node join completed, spovnetid=" << vid.toString() ); … … 153 152 // communication listener 154 153 bool PingPong::onLinkRequest(const NodeID& remote, const DataMessage& msg) { 155 return false; 154 logging_debug( "node " << remote.toString() << " wants to build up a link with us ... allowing" ); 155 return true; 156 156 } 157 157 … … 191 191 } 192 192 193 void PingPong::onMessageSent(seqnum_t seq_num, bool failed, const DataMessage& msg ){194 logging_info( "received message sent event for seqnum " << seq_num195 << " with result " << failed );196 }197 198 193 }}} // namespace ariba, application, pingpong
Note:
See TracChangeset
for help on using the changeset viewer.