Archived

This forum has been archived. Please start a new discussion on GitHub.

The use of context for callbacks

Hi!

Looking again at the callback example, I see how the client sets _fwd in the context before each call to the object implementation, and then sends the context with this (name,value) tupple to the object implementation, in a call like twoway->initiateCallback(twowayR, context);.

However, it is not obvious how the servant makes use of this context information. The code in file CallbackI.cpp is beautifully short and simple, I would even say deceitfully simple, but what is the use of the context? I would have expected to see a switch-like if test in which the servant painfully prepares itself to answer the callback in the appropriate manner, based on the value set in _fwd by the client.

Anythink I can read in the documentation which throws light on this issue?

Thanks,
Catalin

Comments

  • mes
    mes California
    Hi,

    The _fwd context is a special name recognized by Glacier that determines how Glacier forwards the request. The callback example includes this context in case the example is run with Glacier.

    Take care,
    - Mark