Hazelcast C++ Client
Hazelcast C++ Client Library
Loading...
Searching...
No Matches
client_network_config.h
1/*
2 * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved.
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#pragma once
17
18#include "hazelcast/util/export.h"
19#include "hazelcast/client/config/ssl_config.h"
20#include "hazelcast/client/config/client_aws_config.h"
21#include "hazelcast/client/config/socket_options.h"
22#include "hazelcast/client/config/cloud_config.h"
23
24#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
25#pragma warning(push)
26#pragma warning(disable : 4251) // for dll export
27#endif
28
29namespace hazelcast {
30namespace client {
31namespace config {
35class HAZELCAST_API client_network_config
36{
37public:
43
51
60
69 const std::chrono::milliseconds& timeout);
70
76 std::chrono::milliseconds get_connection_timeout() const;
77
86
93
100
106 bool is_smart_routing() const;
107
122 client_network_config& set_smart_routing(bool smart_routing);
123
130 std::vector<address> get_addresses() const;
131
139 client_network_config& add_addresses(const std::vector<address>& addresses);
140
148 client_network_config& set_addresses(const std::vector<address>& addresses);
149
158
159 socket_options& get_socket_options();
160
166 bool use_public_address() const;
167
175 client_network_config& use_public_address(bool should_use_public_address);
176
177private:
178 config::ssl_config ssl_config_;
179 config::client_aws_config client_aws_config_;
180 config::cloud_config cloud_config_;
181
182 std::chrono::milliseconds connection_timeout_;
183 bool smart_routing_;
184
185 std::vector<address> address_list_;
186
187 socket_options socket_options_;
188
189 bool use_public_address_{ false };
190};
191} // namespace config
192} // namespace client
193} // namespace hazelcast
194
195#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
196#pragma warning(pop)
197#endif
Represents an address of a client or member in the cluster.
Definition address.h:37
The client_aws_config contains the configuration for client to connect to nodes in aws environment.
client_network_config & set_addresses(const std::vector< address > &addresses)
Adds given addresses to candidate address list that client will use to establish initial connection.
Definition config.cpp:391
bool is_smart_routing() const
See client_network_config::setSmartRouting(boolean) for details.
Definition config.cpp:364
std::vector< address > get_addresses() const
Returns the list of candidate addresses that client will use to establish initial connection.
Definition config.cpp:377
client_network_config & add_addresses(const std::vector< address > &addresses)
Adds given addresses to candidate address list that client will use to establish initial connection.
Definition config.cpp:383
client_network_config & add_address(const address &address)
Adds given address to candidate address list that client will use to establish initial connection.
Definition config.cpp:398
client_network_config & set_smart_routing(bool smart_routing)
If true, client will route the key based operations to owner of the key on best-effort basis.
Definition config.cpp:370
client_network_config & set_connection_timeout(const std::chrono::milliseconds &timeout)
Definition config.cpp:411
client_aws_config & get_aws_config()
Returns the current client_aws_config.
Definition config.cpp:352
ssl_config & get_ssl_config()
Returns the current \ssl_config .
Definition config.cpp:325
client_network_config()
Constructor with default values.
Definition config.cpp:319
std::chrono::milliseconds get_connection_timeout() const
Connection timeout value for connecting to a member server.
Definition config.cpp:338
cloud_config & get_cloud_config()
Returns the current cloud_config.
Definition config.cpp:358
client_network_config & set_aws_config(const client_aws_config &client_aws_config)
Sets configuration to connect nodes in aws environment.
Definition config.cpp:344
client_network_config & set_ssl_config(const config::ssl_config &config)
Sets the ssl_config.
Definition config.cpp:331
Contains configuration parameters for ssl related behaviour.
Definition ssl_config.h:67
hazelcast.cloud configuration to let the client connect the cluster via hazelcast....