[tao-users] TAO Callback Timeout

Phil Mesnier mesnier_p at ociweb.com
Mon Apr 27 13:47:08 CDT 2015

Hi Martin.

> On Apr 27, 2015, at 7:12 AM, Winkler Martin <M.Winkler at hainzl.at> wrote:
> Hello,
> i have problems to set a timeout on a callback object.


> My application consists of a clients, which registers a callback on a server. The clients and the server are using AMH and AMI. On the Client I resolve an object from the server over a name service, and set a timeout policy on that object. That works fine.

Great. I’m glad to see someone else embracing Asynchronous messaging! I used it to improve the performance of the Implementation Repository while keeping it single threaded. 

> What is not clear to me is, how to set the timeout on the callback object which gets registered on the server. How do I set the timeout on the callback?  Has this to be done on the client or the server? (I’d like to get a timeout, when the server calls back to the client and the request takes too long).
> When I set a global RELATIVE_RT_TIMEOUT_POLICY on the server orb, the timeouts are working. But I’d like to use timeouts on individual objects.
> Any suggestions?

Sure. The server becomes a client of the callback object. You apply a RRTT policy to the callback reference by using set_policy_overrides () on the callback reference. Remember to take the returned object reference and narrow it back to the callback reference type.

For example see ImR_Locator_i::server_is_running() in $TAO_ROOT/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp and for handling the timeout see 
PingReceiver::ping_excep () in $TAO_ROOT/orbsvcs/ImplRepo_Service/LiveCheck.cpp

Feel free to follow up if you have more questions.

Best regards,

Phil Mesnier
Principal Software Engineer and Partner,   http://www.ociweb.com
Object Computing, Inc.                     +01.314.579.0066 x225

More information about the tao-users mailing list