Changeset 3056 for sample


Ignore:
Timestamp:
Apr 23, 2009, 6:58:34 PM (15 years ago)
Author:
Christoph Mayer
Message:

-fixed all compile errors, but now the overlay functionality is messed up somewhere

Location:
sample/pingpong
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sample/pingpong/PingPong.cpp

    r3055 r3056  
    1313
    1414// the service that the pingpong wants to use
    15 ServiceID PingPong::PINGPONG_ID = ServiceID( 111 );
     15ServiceID PingPong::PINGPONG_SERVICEID = ServiceID( 111 );
    1616
    1717// construction
     
    6363
    6464        // 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*/
    6767
    6868        // start node module
     
    8888
    8989        // 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*/
    9292
    9393        // leave spovnet
     
    121121        vector<NodeID> nodes = node->getNeighborNodes();
    122122        BOOST_FOREACH( NodeID nid, nodes ){
    123                 node->sendMessage( pingmsg, nid, PingPong::PINGPONG_ID );
     123                node->sendMessage( pingmsg, nid, PingPong::PINGPONG_SERVICEID );
    124124        }
    125125
     
    128128        //           internally, gets all neighboring nodes and sends the message
    129129        //-----------------------------------------------------------------------
    130         // node->sendBroadcastMessage( pingmsg, PingPong::PINGPONG_ID );
     130        // node->sendBroadcastMessage( pingmsg, PingPong::PINGPONG_SERVICEID );
    131131}
    132132
    133 // node listener interface
    134133void PingPong::onJoinCompleted( const SpoVNetID& vid ) {
    135134        logging_info( "pingpong node join completed, spovnetid=" << vid.toString() );
     
    153152// communication listener
    154153bool 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;
    156156}
    157157
     
    191191}
    192192
    193 void PingPong::onMessageSent(seqnum_t seq_num, bool failed, const DataMessage& msg ){
    194         logging_info( "received message sent event for seqnum " << seq_num
    195                         << " with result " << failed );
    196 }
    197 
    198193}}} // namespace ariba, application, pingpong
  • sample/pingpong/PingPong.h

    r3037 r3056  
    4242        virtual void onLinkFail(const LinkID& lnk, const NodeID& remote);
    4343        virtual void onLinkQoSChanged(const LinkID& lnk, const NodeID& remote, const LinkProperties& prop);
    44         virtual void onMessageSent(seqnum_t seq_num, bool failed, const DataMessage& msg = DataMessage::UNSPECIFIED);
    4544
    4645        // node listener interface
     
    6059        // the ariba module and a node
    6160        AribaModule* ariba;
    62         Node* node;
     61        Node*        node;
    6362
    6463        // flag, whether this node initiates or just joins the spovnet
     
    6665
    6766        // the ping pong service id
    68         static ServiceID PINGPONG_ID;
     67        static ServiceID PINGPONG_SERVICEID;
    6968
    7069        // the current ping id
Note: See TracChangeset for help on using the changeset viewer.