Skip to main content

Problem:

Client always TIMEOUT when using BindOptions structure to set the Timeout values

Resolution:

Client always TIMEOUT when using BindOptions structure to set the Timeout values

Tested Product/ Environment Description

Product/Component Name: VisiBroker CPP
Version: 6.5 and later.
Component: Core
Platform: All (Identified on Linux Redhat 9.0)

Scope of the Document

This article highlights and addresses the erroneous behavior detected in applications using deprecated BindOptions structure.

Problem Description

It is seen that Visibroker Client application with timeout values set gives CORBA::Timeout exceptions for all calls when the code is using deprecated BindOptions structure to set the Timeout policies as follows:

Problematic Code Snippet:

CORBA::BindOptions *bo = CORBA::Object::_default_bind_options();

bo->send_timeout = 5;

bo->receive_timeout = 10;

Correction

The following properties are the cause of the problem because structure CORBA::BindOptions is deprecated since versions even earliar than Visibroker 6.0, somehow till Visibroker 6.0 internally ORB still supported these properties, so one might have not noticed but its use is not recommended. Please refer to "VisiBroker for C API Refernce ---> Core interfaces and classes" under Help.

So, the correct way to implement it is through following Qos Properties as also shown in the examples shipped under \\examples\\vbe\\QoS_policies\\timeout:


RELATIVE_REQ_TIMEOUT_POLICY_TYPE
This policy value allows you to indicate the relative amount of time for which a Request may be delivered. After this amount of time the Request is canceled. Please note that the request timeout could occur due to various factors such as network load or TCP buffers being full.

RELATIVE_RT_TIMEOUT_POLICY_TYPE
This policy value allows you to indicate the relative amount of time for which a Request or its corresponding Reply may be delivered. After this amount of time the Request is cancelled, if a response is not yet been delivered, or the Reply is discarded, if a Request had already been delivered and a Reply is returned from the target.

Other Useful Readings

http://support.borland.com/entry!default.jspa?categoryID=124&externalID=419&fromSearchPage=true ? (please search by keyword ? ?BindOptions? in the Migration guide to fetch information on the topic discussed herewith)

http://support.borland.com/entry!default.jspa?categoryID=123&externalID=16642&fromSearchPage=true

Author

Chetna Bakshi

Old KB# 26252

#VisiBroker
#Security