Each client (a connection owner) who created one or more subscriptions (see ConEvents::Subscribe) must perform retrieving events by periodic calling of the method ConEvents::Retrieve. The value of that period is returned from methods ConEvents::Retrieve and ConEvents::Subscribe (see nPeriod parameter).
Recommended algorithm of retrieving events:
- The client has a variable that stores the value of polling period (further 'polling period variable'). Its initial value must be 0.
- After calling the method ConEvents::Subscribe the client must update the value polling period variable by the value of nPeriod parameter. Then the client must schedule calling of the method ConEvents::Retrieve according to the new value of the polling period variable.
- If the current value of the polling period variable is not 0 the client must call method ConEvents::Retrieve iteratively until it returns true. Then the client must update the value polling period variable by the value of nPeriod parameter. Then the client must schedule next call of the method ConEvents::Retrieve according to the new value of the polling period variable.
- If the current value of the polling period variable is 0 the client must not call method ConEvents::Retrieve.
- After the client has unsubscribed from all events (ConEvents::UnSubscribe) it must not call ConEvents::Retrieve method any more.