24 #include <netinet/in.h>
32 #include <aerospike/ck/ck_pr.h>
41 #define AS_HOSTNAME_SIZE 256
46 #define AS_NODE_NAME_SIZE 20
49 #define AS_NODE_NAME_MAX_SIZE AS_NODE_NAME_SIZE
51 #define AS_FEATURES_GEO (1 << 0)
52 #define AS_FEATURES_DOUBLE (1 << 1)
53 #define AS_FEATURES_BATCH_INDEX (1 << 2)
54 #define AS_FEATURES_REPLICAS_ALL (1 << 3)
55 #define AS_FEATURES_PIPELINING (1 << 4)
56 #define AS_FEATURES_PEERS (1 << 5)
58 #define AS_ADDRESS4_MAX 4
59 #define AS_ADDRESS6_MAX 8
68 typedef struct as_address_s {
72 struct sockaddr_storage addr;
85 typedef struct as_alias_s {
104 typedef struct as_conn_pool_s {
130 typedef struct as_conn_pool_lock_s {
150 typedef struct as_node_s {
291 typedef struct as_node_info_s {
395 struct as_cluster_s* cluster,
const char* hostname,
const char* tls_name,
396 in_port_t port,
bool is_alias,
struct sockaddr* addr,
as_node_info* node_info
414 ck_pr_store_8(&node->
active,
false);
438 ck_pr_dec_32_zero(&node->
ref_count, &destroy);
471 static inline const char*
499 pthread_mutex_lock(&pool_lock->
lock);
501 pthread_mutex_unlock(&pool_lock->
lock);
515 if (max_socket_idle == 0 && sock->
ctx) {
516 max_socket_idle = 55;
519 if (max_socket_idle > 0) {
520 sock->
idle_check.max_socket_idle = max_socket_idle;
521 sock->
idle_check.last_used = (uint32_t)cf_get_seconds();
528 pthread_mutex_lock(&pool_lock->
lock);
530 pthread_mutex_unlock(&pool_lock->
lock);
534 pthread_mutex_lock(&pool_lock->
lock);
536 pthread_mutex_unlock(&pool_lock->
lock);