Lightstreamer C++ Client SDK
Loading...
Searching...
No Matches
ConnectionOptions.h
1/*
2 * Copyright (C) 2023 Lightstreamer Srl
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef INCLUDED_Lightstreamer_ConnectionOptions
17#define INCLUDED_Lightstreamer_ConnectionOptions
18
19#include "../Lightstreamer.h"
20
21namespace Lightstreamer {
22
34 HaxeObject _delegate = nullptr;
35
36 void initDelegate(HaxeObject client) {
37 _delegate = LightstreamerClient_getConnectionOptions(client);
38 }
39
40 friend class LightstreamerClient;
41public:
42 ConnectionOptions(const ConnectionOptions&) = delete;
43 ConnectionOptions& operator=(const ConnectionOptions&) = delete;
44
46
48 Lightstreamer_releaseHaxeObject(_delegate);
49 }
58 return ConnectionOptions_getContentLength(_delegate);
59 }
68 return ConnectionOptions_getFirstRetryMaxDelay(_delegate);
69 }
76 std::string getForcedTransport() {
77 return ConnectionOptions_getForcedTransport(_delegate);
78 }
86 std::map<std::string, std::string> getHttpExtraHeaders() {
87 return ConnectionOptions_getHttpExtraHeaders(_delegate);
88 }
99 return ConnectionOptions_getIdleTimeout(_delegate);
100 }
116 return ConnectionOptions_getKeepaliveInterval(_delegate);
117 }
129 return ConnectionOptions_getRequestedMaxBandwidth(_delegate);
130 }
150 std::string getRealMaxBandwidth() {
151 return ConnectionOptions_getRealMaxBandwidth(_delegate);
152 }
164 return ConnectionOptions_getPollingInterval(_delegate);
165 }
176 return ConnectionOptions_getReconnectTimeout(_delegate);
177 }
189 return ConnectionOptions_getRetryDelay(_delegate);
190 }
199 return ConnectionOptions_getReverseHeartbeatInterval(_delegate);
200 }
210 return ConnectionOptions_getStalledTimeout(_delegate);
211 }
222 return ConnectionOptions_getSessionRecoveryTimeout(_delegate);
223 }
233 return ConnectionOptions_isHttpExtraHeadersOnSessionCreationOnly(_delegate);
234 }
243 return ConnectionOptions_isServerInstanceAddressIgnored(_delegate);
244 }
252 return ConnectionOptions_isSlowingEnabled(_delegate);
253 }
275 void setContentLength(long contentLength) {
276 ConnectionOptions_setContentLength(_delegate, contentLength);
277 }
300 void setFirstRetryMaxDelay(long firstRetryMaxDelay) {
301 ConnectionOptions_setFirstRetryMaxDelay(_delegate, firstRetryMaxDelay);
302 }
346 void setForcedTransport(const std::string& forcedTransport) {
347 ConnectionOptions_setForcedTransport(_delegate, &forcedTransport);
348 }
372 void setHttpExtraHeaders(const std::map<std::string, std::string>& headers) {
373 ConnectionOptions_setHttpExtraHeaders(_delegate, &headers);
374 }
393 void setHttpExtraHeadersOnSessionCreationOnly(bool httpExtraHeadersOnSessionCreationOnly) {
394 ConnectionOptions_setHttpExtraHeadersOnSessionCreationOnly(_delegate, httpExtraHeadersOnSessionCreationOnly);
395 }
420 void setIdleTimeout(long idleTimeout) {
421 ConnectionOptions_setIdleTimeout(_delegate, idleTimeout);
422 }
448 void setKeepaliveInterval(long keepaliveInterval) {
449 ConnectionOptions_setKeepaliveInterval(_delegate, keepaliveInterval);
450 }
481 void setRequestedMaxBandwidth(const std::string& maxBandwidth) {
482 ConnectionOptions_setRequestedMaxBandwidth(_delegate, &maxBandwidth);
483 }
516 void setPollingInterval(long pollingInterval) {
517 ConnectionOptions_setPollingInterval(_delegate, pollingInterval);
518 }
542 void setReconnectTimeout(long reconnectTimeout) {
543 ConnectionOptions_setReconnectTimeout(_delegate, reconnectTimeout);
544 }
592 void setRetryDelay(long retryDelay) {
593 ConnectionOptions_setRetryDelay(_delegate, retryDelay);
594 }
638 void setReverseHeartbeatInterval(long reverseHeartbeatInterval) {
639 ConnectionOptions_setReverseHeartbeatInterval(_delegate, reverseHeartbeatInterval);
640 }
669 void setServerInstanceAddressIgnored(bool serverInstanceAddressIgnored) {
670 ConnectionOptions_setServerInstanceAddressIgnored(_delegate, serverInstanceAddressIgnored);
671 }
694 void setSlowingEnabled(bool slowingEnabled) {
695 ConnectionOptions_setSlowingEnabled(_delegate, slowingEnabled);
696 }
716 void setStalledTimeout(long stalledTimeout) {
717 ConnectionOptions_setStalledTimeout(_delegate, stalledTimeout);
718 }
747 void setSessionRecoveryTimeout(long sessionRecoveryTimeout) {
748 ConnectionOptions_setSessionRecoveryTimeout(_delegate, sessionRecoveryTimeout);
749 }
750};
751
752} // namespace Lightstreamer
753
754#endif // INCLUDED_Lightstreamer_ConnectionOptions
Used by LightstreamerClient to provide an extra connection properties data object.
Definition ConnectionOptions.h:33
std::string getForcedTransport()
Inquiry method that gets the value of the forced transport (if any).
Definition ConnectionOptions.h:76
void setContentLength(long contentLength)
Setter method that sets the length in bytes to be used by the Server for the response body on a strea...
Definition ConnectionOptions.h:275
std::string getRealMaxBandwidth()
Inquiry method that gets the maximum bandwidth that can be consumed for the data coming from Lightstr...
Definition ConnectionOptions.h:150
void setHttpExtraHeaders(const std::map< std::string, std::string > &headers)
Setter method that enables/disables the setting of extra HTTP headers to all the request performed to...
Definition ConnectionOptions.h:372
void setForcedTransport(const std::string &forcedTransport)
Setter method that can be used to disable/enable the Stream-Sense algorithm and to force the client t...
Definition ConnectionOptions.h:346
std::string getRequestedMaxBandwidth()
Inquiry method that gets the maximum bandwidth that can be consumed for the data coming from Lightstr...
Definition ConnectionOptions.h:128
void setServerInstanceAddressIgnored(bool serverInstanceAddressIgnored)
Setter method that can be used to disable/enable the automatic handling of server instance address th...
Definition ConnectionOptions.h:669
void setFirstRetryMaxDelay(long firstRetryMaxDelay)
Setter method that sets the maximum time to wait before trying a new connection to the Server in case...
Definition ConnectionOptions.h:300
void setHttpExtraHeadersOnSessionCreationOnly(bool httpExtraHeadersOnSessionCreationOnly)
Setter method that enables/disables a restriction on the forwarding of the extra http headers specifi...
Definition ConnectionOptions.h:393
bool isHttpExtraHeadersOnSessionCreationOnly()
Inquiry method that checks if the restriction on the forwarding of the configured extra http headers ...
Definition ConnectionOptions.h:232
long getContentLength()
Inquiry method that gets the length expressed in bytes to be used by the Server for the response body...
Definition ConnectionOptions.h:57
bool isServerInstanceAddressIgnored()
Inquiry method that checks if the client is going to ignore the server instance address that will pos...
Definition ConnectionOptions.h:242
long getKeepaliveInterval()
Inquiry method that gets the interval between two keepalive packets sent by Lightstreamer Server on a...
Definition ConnectionOptions.h:115
void setRetryDelay(long retryDelay)
Setter method that sets.
Definition ConnectionOptions.h:592
void setPollingInterval(long pollingInterval)
Setter method that sets the polling interval used for polling connections.
Definition ConnectionOptions.h:516
void setReverseHeartbeatInterval(long reverseHeartbeatInterval)
Setter method that enables/disables the reverse-heartbeat mechanism by setting the heartbeat interval...
Definition ConnectionOptions.h:638
long getReconnectTimeout()
Inquiry method that gets the time the client, after entering "STALLED" status, is allowed to keep wai...
Definition ConnectionOptions.h:175
void setIdleTimeout(long idleTimeout)
Setter method that sets the maximum time the Server is allowed to wait for any data to be sent in res...
Definition ConnectionOptions.h:420
std::map< std::string, std::string > getHttpExtraHeaders()
Inquiry method that gets a map object containing the extra headers to be sent to the server.
Definition ConnectionOptions.h:86
bool isSlowingEnabled()
Inquiry method that checks if the slowing algorithm is enabled or not.
Definition ConnectionOptions.h:251
void setSessionRecoveryTimeout(long sessionRecoveryTimeout)
Setter method that sets the maximum time allowed for attempts to recover the current session upon an ...
Definition ConnectionOptions.h:747
void setRequestedMaxBandwidth(const std::string &maxBandwidth)
Setter method that sets the maximum bandwidth expressed in kilobits/s that can be consumed for the da...
Definition ConnectionOptions.h:481
long getIdleTimeout()
Inquiry method that gets the maximum time the Server is allowed to wait for any data to be sent in re...
Definition ConnectionOptions.h:98
void setReconnectTimeout(long reconnectTimeout)
Setter method that sets the time the client, after entering "STALLED" status, is allowed to keep wait...
Definition ConnectionOptions.h:542
long getReverseHeartbeatInterval()
Inquiry method that gets the reverse-heartbeat interval expressed in milliseconds.
Definition ConnectionOptions.h:198
void setKeepaliveInterval(long keepaliveInterval)
Setter method that sets the interval between two keepalive packets to be sent by Lightstreamer Server...
Definition ConnectionOptions.h:448
void setStalledTimeout(long stalledTimeout)
Setter method that sets the extra time the client is allowed to wait when an expected keepalive packe...
Definition ConnectionOptions.h:716
long getStalledTimeout()
Inquiry method that gets the extra time the client can wait when an expected keepalive packet has not...
Definition ConnectionOptions.h:209
long getRetryDelay()
Inquiry method that gets the minimum time to wait before trying a new connection to the Server in cas...
Definition ConnectionOptions.h:188
long getSessionRecoveryTimeout()
Inquiry method that gets the maximum time allowed for attempts to recover the current session upon an...
Definition ConnectionOptions.h:221
long getFirstRetryMaxDelay()
Inquiry method that gets the maximum time to wait before trying a new connection to the Server in cas...
Definition ConnectionOptions.h:67
void setSlowingEnabled(bool slowingEnabled)
Setter method that turns on or off the slowing algorithm.
Definition ConnectionOptions.h:694
long getPollingInterval()
Inquiry method that gets the polling interval used for polling connections.
Definition ConnectionOptions.h:163
Facade class for the management of the communication to Lightstreamer Server.
Definition LightstreamerClient.h:49