How do we know snapshot(RFA) request has been fulfilled?

Snapshot requests result in multiple responses, how do we know snapshot request has been fulfilled. So that we can close the connection with TREP.

Tagged:

Best Answer

  • warat.boonyanit
    Answer ✓

    It is best to just follow the "Closing Event Streams" procedure.

    The application should call isEventStreamClosed() function on incoming messages to determine whether an event
    stream is closed.

    If the isEventStreamClosed() function call returns true, then the stream is closed and the application can clean up
    its resources.

    void processEvent(const rfa::common::Event & event )
    {
    switch( event.getType() )
    {
    case ConnectionEventEnum:
    processConnectionEvent( static_cast<const ConnectionEvent &>( event ) );
    break;
    case OMMItemEventEnum:
    processOMMItemEvent( static_cast<const OMMItemEvent &>( event ) );
    break;
    case OMMCmdErrorEventEnum:
    processOMMCmdErrorEvent( static_cast<const OMMCmdErrorEvent &>( event ) );
    break;
    case LoggerNotifyEventEnum:
    processLoggerNotifyEvent( static_cast<const LoggerNotifyEvent &>( event ) );
    break;
    default:
    break;
    }
    if ( event.isEventStreamClosed() )
    //Event stream is closed. Application can clean up related resources.
    }

Answers