question

Upvotes
Accepted
33 9 13 31

EMA C++: will the 'handle' long value be reused?

For an EMA C++ application, will the 'handle' long value be reused?

What's the rules of the 'handle' long value assigned to a single RIC stream or batch stream? e.g., unique and auto-incremented integer?

ema-api
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.

1 Answer

· Write an Answer
Upvote
Accepted
79.2k 251 52 74

@Frederic

In EMA C++, the handle is a memory address of an internal object. The object is allocated when the application calls the register method, and then EMA returns the address of the object to the application. The object is de-allocated when the application called the un-register method. The de-allocated memory can be reused by the process.

I found the following statement in the EMA C++ developer guide.

The Enterprise Message API assigns all opened items or instruments a unique numeric identifier (e.g. UInt64), called a handle, which is returned by the OmmConsumer::registerClient() call. A handle is valid as long as its associated item stays open. Holding onto these handles is important only to applications that want to modify or close particular items, or use the items’ streams for sending PostMsg or GenericMsg messages to the connected server. Applications that just open and watch several items until they exit do not need to store item handles. 



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.