Ignore:
Timestamp:
Apr 22, 2009, 9:07:53 PM (15 years ago)
Author:
Christoph Mayer
Message:

-jede Menge fixes und Umstellungen
-angefangen ariba/interface los zu werden, erste dateien sind weg

Location:
source/ariba/communication
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/communication/BaseCommunication.cpp

    r2802 r3037  
    5555const BaseCommunication::LinkDescriptor BaseCommunication::LinkDescriptor::UNSPECIFIED;
    5656
    57 BaseCommunication::BaseCommunication(const NetworkLocator* _locallocator, const uint16_t _listenport)
    58         : messageReceiver( NULL ), currentSeqnum( 0 ), listenport( _listenport ) {
     57BaseCommunication::BaseCommunication()
     58        : messageReceiver(NULL), network(NULL), transport(NULL){
     59}
     60
     61BaseCommunication::~BaseCommunication(){
     62}
     63
     64void BaseCommunication::start(const NetworkLocator* _locallocator, const uint16_t _listenport){
     65
     66        currentSeqnum = 0;
     67        listenport = _listenport;
    5968
    6069        logging_info( "starting up base communication and creating transports ..." );
     
    139148}
    140149
    141 BaseCommunication::~BaseCommunication() {
     150void BaseCommunication::stop() {
    142151
    143152        logging_info( "stopping base communication and transport ..." );
     
    210219        // warn if this link has some queued messages attached
    211220        if( descriptor.waitingmsg.size() > 0 ){
    212                 logging_warn( "dropping link " << link.toString() << 
     221                logging_warn( "dropping link " << link.toString() <<
    213222                        " that has " << descriptor.waitingmsg.size() << " waiting messages" );
    214223        }
     
    368377                const NetworkLocator* remoteLocator = dynamic_cast<const NetworkLocator*>(message->getSourceAddress());
    369378
    370                 logging_debug( "localLocator=" << localLocator->toString() 
     379                logging_debug( "localLocator=" << localLocator->toString()
    371380                                << " remoteLocator=" << remoteLocator->toString());
    372381
     
    419428                // the link is now open
    420429                //
    421                
     430
    422431                BOOST_FOREACH( CommunicationEvents* i, eventListener ){
    423432                        i->onLinkUp( localLink, localLocator, remoteLocator );
     
    444453
    445454                linkDesc.remoteLink = spovmsg->getLocalLink();
    446                 linkDesc.linkup = true; 
    447        
     455                linkDesc.linkup = true;
     456
    448457                logging_debug( "the link is now up with local link id " << spovmsg->getRemoteLink().toString() );
    449458
     
    452461                }
    453462
    454                 if( linkDesc.waitingmsg.size() > 0 ){ 
     463                if( linkDesc.waitingmsg.size() > 0 ){
    455464                        logging_info( "sending out queued messages on link " << linkDesc.localLink.toString() );
    456465
     
    564573        for( ; i != iend; i++){
    565574                if( (*i).localLink != localLink) continue;
    566                
     575
    567576                BOOST_FOREACH( Message* msg, i->waitingmsg ){
    568577                        delete msg;
  • source/ariba/communication/BaseCommunication.h

    r2483 r3037  
    122122 */
    123123class BaseCommunication : public MessageReceiver, NetworkChangeInterface {
    124 
    125124        use_logging_h(BaseCommunication);
    126 
    127125public:
    128         /**
    129          * Constructs a Base Communication instance.
    130          * Listens default on port number 41402
    131          */
    132         BaseCommunication(const NetworkLocator* _locallocator, const uint16_t _listenport);
    133 
    134         /**
    135          * Destructs a Base Communication instance
     126
     127        /**
     128         * Default ctor that just creates an empty
     129         * non functional base communication
     130         */
     131        BaseCommunication();
     132
     133        /**
     134         * Default dtor that does nothing
    136135         */
    137136        virtual ~BaseCommunication();
     137
     138        /**
     139         * Startup the base communication, start modules etc.
     140         */
     141        void start(const NetworkLocator* _locallocator, const uint16_t _listenport);
     142
     143        /**
     144         * stop the base communication, stop modules etc.
     145         */
     146        void stop();
    138147
    139148        /**
  • source/ariba/communication/EndpointDescriptor.cpp

    r2457 r3037  
    5757
    5858EndpointDescriptor::EndpointDescriptor(const Locator* _locator){
     59        if( _locator == NULL ) return;
     60
    5961        locator = new IPv4Locator(*dynamic_cast<IPv4Locator*>((Locator*)_locator));
    6062        isUnspec = false;
  • source/ariba/communication/EndpointDescriptor.h

    r3036 r3037  
    5151using ariba::communication::IPv4Locator;
    5252
    53 // needed for friend decleration
    54 // in different namespace
    55 namespace ariba {
    56 namespace interface {
    57         class UnderlayAbstraction;
    58 }}
    59 
    6053namespace ariba {
    6154namespace communication {
     
    6760
    6861        friend class BaseCommunication;
    69         friend class ariba::interface::UnderlayAbstraction;
    7062
    7163public:
Note: See TracChangeset for help on using the changeset viewer.