What is event type 2 in Open DACS API?

I notice that sometime my Open DACS application receive event type 2 after the user call logout. From the dacsSubscribeClient example, it seems to check only event type RFA_DACS_PACKAGE.


In which case does DACS send the event type 2?

Best Answer

  • Bondy_Bo
    Answer ✓

    I did some research and found that the event type 2 is RFA Completion Event and the Open DACS application will receive completion event if it set the completion event flag to true when calling AuthorizationSystem::createAuthorizationAgent. The dacsSubscribeClient set it to true by default.

    However with initial test using the example, it seems like I did not get completion event. This is because the example does not keep dispatching after calling logout.
    I have changed the example to call waitForCallbackEvent as below and I can get event type 2 as my application.

    // Log out. 
    pClient->logout();
    pClient->waitForCallbackEvent(waitTime);

    And then add codes to check completion event in processEvent method

    void DacsSubscribeClient::processEvent(const Event &event) {

    if(eventType == rfa::common::ComplEventEnum)
    {
    std::cout<<"****** Receive Completion Event"<<std::endl;
    }

    }

Answers

  • dacsSubscribeClient example shows dacs event handling. OpenDacs uses RFA libraries, which are grouped into packages. RFA_PACKAGE_2 events are RFASessionLayer events described in RFA include SessionLayerEnums.h