question

Upvotes
Accepted
588 14 21 19

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?

apiDACSopen-dacseventslog-out
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
588 14 21 19

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;
    }
… 
}
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
32.2k 40 11 20

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

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.