BLPAPI C++
3.22.1
|
#include <blpapi_sessionoptions.h>
Public Types | |
enum | ClientMode { AUTO = 0, DAPI = 1, SAPI = 2 } |
Contains the options which the user can specify when creating a session.
To use non-default options on a Session, create a SessionOptions instance and set the required options and then supply it when creating a Session.
enum ClientMode |
SessionOptions | ( | ) |
Create a SessionOptions with all options set to the standard defaults.
SessionOptions | ( | const SessionOptions & | original | ) |
Copy constructor
~SessionOptions | ( | ) |
Destroy this SessionOptions.
bool allowMultipleCorrelatorsPerMsg | ( | ) | const |
Return the value of the allow multiple correlators per message option in this SessionOptions instance.
std::string applicationIdentityKey | ( | ) |
Return the application identity key (AIK) which uniquely identifies this application for this session.
const char * authenticationOptions | ( | ) | const |
Return authentication options in a string.
bool autoRestartOnDisconnection | ( | ) | const |
Return whether automatically restarting connection if disconnected.
bool bandwidthSaveModeDisabled | ( | ) | const |
Return true
if bandwidth saving measures have been disabled; otherwise return false
.
int clientMode | ( | ) | const |
Return the value of the client mode option in this SessionOptions instance.
unsigned int connectTimeout | ( | ) | const |
Return the value of the connection timeout option in this SessionOptions instance in milliseconds.
int defaultKeepAliveInactivityTime | ( | ) | const |
Return the interval (in milliseconds) a connection has to remain inactive (receive no data) before a keep alive probe will be sent.
int defaultKeepAliveResponseTimeout | ( | ) | const |
Return the time (in milliseconds) the library will wait for response to a keep alive probe before declaring it lost.
const char * defaultServices | ( | ) | const |
Return all default services in one string.
const char * defaultSubscriptionService | ( | ) | const |
Return a pointer to the value of the default subscription service option in this SessionOptions instance. The pointer is valid until this SessionOptions is destroyed or setDefaultSubscriptionService() is called.
const char * defaultTopicPrefix | ( | ) | const |
Return a pointer to the value of the default topic prefix option in this SessionOptions instance. The pointer is valid until this SessionOptions is destroyed or setDefaultTopicPrefix() is called.
int flushPublishedEventsTimeout | ( | ) | const |
Return the timeout, in milliseconds, for ProviderSession to flush published events before stopping. The default value is 2000.
int getServerAddress | ( | const char ** | serverHost, |
unsigned short * | serverPort, | ||
size_t | index | ||
) | const |
Put the server name and port into serverHost
and serverPort
indexed by index
. Return 0 if succeeded; otherwise, return non-zero.
int getServerAddress | ( | const char ** | serverHost, |
unsigned short * | serverPort, | ||
Socks5Config * | socksConfig, | ||
size_t | index | ||
) | const |
Put the server name and port into serverHost
, serverPort
, and associated socksConfig
indexed by index
. Return 0 if succeeded; otherwise, return non-zero. Behavior is undefined if serverHost
, serverPort
, or socksConfig
is nullptr
.
blpapi_SessionOptions_t * handle | ( | ) | const |
Return the handle of the current session options.
bool keepAliveEnabled | ( | ) | const |
Return true
if the keep-alive mechanism is enabled; otherwise return false
.
size_t maxEventQueueSize | ( | ) | const |
Return the value of maximum outstanding undelivered events that the session is configured with.
int maxPendingRequests | ( | ) | const |
Return the value of the maximum pending request option in this SessionOptions instance.
size_t numServerAddresses | ( | ) | const |
Return the number of server addresses.
int numStartAttempts | ( | ) | const |
Return the maximum number of attempts to start a session by connecting a server.
SessionOptions & operator= | ( | const SessionOptions & | rhs | ) |
Assign to this object the value of the specified rhs
object.
std::ostream & print | ( | std::ostream & | stream, |
int | indentLevel = 0 , |
||
int | spacesPerLevel = 4 |
||
) | const |
Format this SessionOptions to the specified output stream
at the (absolute value of) the optionally specified indentation level
and return a reference to stream
. If level
is specified, optionally specify spacesPerLevel
, the number of spaces per indentation level for this and all of its nested objects. If level
is negative, suppress indentation of the first line. If spacesPerLevel
is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level
).
bool recordSubscriptionDataReceiveTimes | ( | ) | const |
Return whether the receipt time (accessed via blpapi::Message::timeReceived) should be recorded for subscription data messages.
int removeServerAddress | ( | size_t | index | ) |
Remove the server address at the specified index
.
const char * serverHost | ( | ) | const |
Return a pointer to the value of the server host option in this SessionOptions instance. The pointer is valid until this SessionOptions is destroyed setServerHost() is called.
unsigned short serverPort | ( | ) | const |
Return the server port that this session connects to. If more than one server addresses are specified, return the port of the first server address.
int serviceCheckTimeout | ( | ) | const |
Return the value of the service check timeout option in this SessionOptions instance in milliseconds.
int serviceDownloadTimeout | ( | ) | const |
Return the value of the service download timeout option in this SessionOptions instance in milliseconds.
std::string sessionName | ( | ) |
Return the session name.
void setAllowMultipleCorrelatorsPerMsg | ( | bool | allowMultipleCorrelatorsPerMsg | ) |
Set whether the Session is allowed to associate more than one CorrelationId with a Message to the specified allowMultipleCorrelatorsPerMsg
. The default is false
. This means that if you have multiple subscriptions which overlap (that is a particular Message is relevant to all of them) you will be presented with the same message multiple times when you use the MessageIterator, each time with a different CorrelationId. If you specify true
for this then a Message may be presented with multiple CorrelationId's.
void setApplicationIdentityKey | ( | const std::string & | applicationIdentityKey | ) |
Set the application identity key (AIK) which uniquely identifies this application for this session.
void setAuthenticationOptions | ( | const char * | authOptions | ) |
Set the specified authOptions
as authentication option.
void setAutoRestartOnDisconnection | ( | bool | autoRestart | ) |
Set whether to automatically retry connecting if the connection to a server gets disconnected. The default is true. The number of times such a retry is attempted is controlled by numStartAttempts.
void setBandwidthSaveModeDisabled | ( | bool | isDisabled | ) |
If the specified isDisabled
is true
, then disable bandwidth saving measures. The default value is false
.
void setClientMode | ( | int | clientMode | ) |
Set how to connect to the API. The default is AUTO which will try to connect to the desktop API but fall back to the server API if the desktop is not available. DAPI always connects to the desktop API and will fail if it is not available. SAPI always connects to the server API and will fail if it is not available.
void setConnectTimeout | ( | unsigned int | timeoutMilliSeconds | ) |
Set the connection timeout in milliseconds when connecting to the API. The default is 5000 milliseconds. Behavior is not defined unless the specified timeoutMilliSeconds
is in range of [1 .. 120000] milliseconds
void setDefaultKeepAliveInactivityTime | ( | int | inactivityMsecs | ) |
Set to the specified inactivityMsecs
the amount of time that no traffic can be received on a connection before the ping-based keep-alive mechanism is triggered; if no traffic is received for this duration then a keep-alive ping is sent to the remote end to solicit a response. If inactivityMsecs == 0
, then no keep-alive pings will be sent. The behavior of this function is undefined unless inactivityMsecs
is a non-negative value. The default value is 20,000 milliseconds. Note that not all back-end connections provide ping-based keep-alives; this option is ignored by such connections.
void setDefaultKeepAliveResponseTimeout | ( | int | timeoutMsecs | ) |
When a keep-alive ping is sent, wait for the specified timeoutMsecs
to receive traffic (of any kind) before terminating the connection due to inactivity. If timeoutMsecs == 0
, then connections are never terminated due to the absence of traffic after a keep-alive ping. The behavior of this function is undefined unless timeoutMsecs
is a non-negative value. The default value is 5,000 milliseconds. Note that not all back-end connections provide support for ping-based keep-alives; this option is ignored by such connections.
void setDefaultServices | ( | const char * | defaultServices | ) |
DEPRECATED
Set the default service for the session. This function is deprecated; see setDefaultSubscriptionService
.
void setDefaultSubscriptionService | ( | const char * | serviceIdentifier | ) |
Set the default service for subscriptions which do not specify a subscription server to the specified serviceIdentifier
. The behavior is undefined unless serviceIdentifier
matches the regular expression ^//[-_.a-zA-Z0-9]+/[-_.a-zA-Z0-9]+$
. The default is "//blp/mktdata". For more information on when this will be used see QUALIFYING SUBSCRIPTION STRINGS
section in blpapi_subscriptionlist
.
void setDefaultTopicPrefix | ( | const char * | prefix | ) |
Set the default topic prefix to be used when a subscription does not specify a prefix to the specified prefix
. The default is "/ticker/". For more information on when this will be used see QUALIFYING SUBSCRIPTION STRINGS
section in blpapi_subscriptionlist
.
void setFlushPublishedEventsTimeout | ( | int | timeoutMsecs | ) |
Set the timeout, in milliseconds, for ProviderSession to flush published events before stopping. The behavior is not defined unless the specified timeoutMsecs
is a positive value. The default value is 2000.
void setKeepAliveEnabled | ( | bool | isEnabled | ) |
If the specified isEnabled
is false
, then disable all keep-alive mechanisms, both from the client to the server and from the server to the client; otherwise enable keep-alive pings both from the client to the server (as configured by setDefaultKeepAliveInactivityTime
and setDefaultKeepAliveResponseTimeout
if the connection supports ping-based keep-alives), and from the server to the client as specified by the server configuration.
void setMaxEventQueueSize | ( | size_t | eventQueueSize | ) |
Set the maximum number of outstanding undelivered events per session to the specified eventQueueSize
. All subsequent events delivered over the network will be dropped by the session if the number of outstanding undelivered events is eventQueueSize
, the specified threshold. The default value is 10000.
void setMaxPendingRequests | ( | int | maxPendingRequests | ) |
Set the maximum number of requests which can be pending to the specified maxPendingRequests
. The default is 1024.
void setNumStartAttempts | ( | int | numStartAttempts | ) |
Set the maximum number of attempts to connect to a server. This option only has effect when autoRestartOnDisconnection
is set to true. The default is 3.
void setRecordSubscriptionDataReceiveTimes | ( | bool | shouldRecord | ) |
Set whether the receipt time (accessed via blpapi::Message::timeReceived) should be recorded for subscription data messages. By default, the receipt time for these messages is not recorded.
int setServerAddress | ( | const char * | serverHost, |
unsigned short | serverPort, | ||
size_t | index | ||
) |
Set the server address at the specified index
in the server list using the specified serverHost
and serverPort
. The default is "127.0.0.1:8194". Behavior is undefined if the specified serverHost
is a nullptr
or points to an empty string.
int setServerAddress | ( | const char * | serverHost, |
unsigned short | serverPort, | ||
const Socks5Config & | socks5Config, | ||
size_t | index | ||
) |
Set the server address at the specified index
in the server list using the specified serverHost
, serverPort
, and socks5Config
.
Behavior is undefined if the specified serverHost
is a nullptr
or points to an empty string.
void setServerHost | ( | const char * | host | ) |
Set the API server host to connect to when using the server API to the specified host
, which is a hostname or an IPv4 address (that is, a.b.c.d). This will update only the first element in the server list. The default is "127.0.0.1". Behavior is undefined if the specified host
is a nullptr
or points to an empty string.
void setServerPort | ( | unsigned short | port | ) |
Set the port to connect to when using the server API to the specified port
. This will update only the first element of the server list. The default port is 8194.
void setServiceCheckTimeout | ( | int | timeoutMsecs | ) |
Set the timeout, in milliseconds, when opening a service for checking what version of the schema should be downloaded. The behavior is not defined unless timeoutMsecs
is a positive value. The default timeout is 120,000 milliseconds.
void setServiceDownloadTimeout | ( | int | timeoutMsecs | ) |
Set the timeout, in milliseconds, when opening a service for downloading the service schema. The behavior is not defined unless the specified timeoutMsecs
is a positive value. The default timeout is 120,000 milliseconds.
CorrelationId setSessionIdentityOptions | ( | const AuthOptions & | authOptions, |
const CorrelationId & | correlationId = CorrelationId() |
||
) |
Set the specified authOptions
as the AuthOptions
for the session identity, enabling automatic authorization of the session identity during startup. The optionally specified correlationId
is used to identify the messages associated with the session identity.
Return the actual CorrelationId
that identifies the messages associated with the session identity.
The session identity lifetime is tied to the session's lifetime, so it is guaranteed that the session identity will remain authorized during the entire duration of the session. The identity will be authorized before the session starts. The session will terminate if the identity fails to authorize or is revoked.
The session identity is used to send requests and make subscriptions if no other identity is provided.
By default the session identity is not authorized.
void setSessionName | ( | const std::string & | sessionName | ) |
Set the session name which can be used to identify the log lines pertaining to the session.
void setSlowConsumerWarningHiWaterMark | ( | float | hiWaterMark | ) |
Set the point at which "slow consumer" events will be generated, using the specified highWaterMark
as a fraction of maxEventQueueSize
; the default value is 0.75. A warning event will be generated when the number of outstanding undelivered events passes above hiWaterMark * maxEventQueueSize
. The behavior of the function is undefined unless 0.0 < hiWaterMark <= 1.0
. Further, at the time that Session.start()
is called, it must be the case that slowConsumerWarningLoWaterMark() * maxEventQueueSize()
< slowConsumerWarningHiWaterMark() * maxEventQueueSize()
.
void setSlowConsumerWarningLoWaterMark | ( | float | loWaterMark | ) |
Set the point at which "slow consumer cleared" events will be generated, using the specified loWaterMark
as a fraction of maxEventQueueSize
; the default value is 0.5. A warning cleared event will be generated when the number of outstanding undelivered events drops below loWaterMark * maxEventQueueSize
. The behavior of the function is undefined unless 0.0 <= loWaterMark < 1.0
. Further, at the time that Session.start()
is called, it must be the case that slowConsumerWarningLoWaterMark() * maxEventQueueSize()
< slowConsumerWarningHiWaterMark() * maxEventQueueSize()
.
void setTlsOptions | ( | const TlsOptions & | tlsOptions | ) |
Set the TLS options to the specified tlsOptions
.
float slowConsumerWarningHiWaterMark | ( | ) | const |
Return the fraction of maxEventQueueSize at which "slow consumer" event will be generated.
float slowConsumerWarningLoWaterMark | ( | ) | const |
Return the fraction of maxEventQueueSize at which "slow consumer cleared" event will be generated.