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)
57 #define AS_FEATURES_REPLICAS (1 << 6)
59 #define AS_ADDRESS4_MAX 4
60 #define AS_ADDRESS6_MAX 8
69 typedef struct as_address_s {
73 struct sockaddr_storage addr;
86 typedef struct as_alias_s {
105 typedef struct as_conn_pool_s {
131 typedef struct as_conn_pool_lock_s {
151 typedef struct as_node_s {
292 typedef struct as_node_info_s {
396 struct as_cluster_s* cluster,
const char* hostname,
const char* tls_name,
397 in_port_t port,
bool is_alias,
struct sockaddr* addr,
as_node_info* node_info
415 ck_pr_store_8(&node->
active,
false);
439 ck_pr_dec_32_zero(&node->
ref_count, &destroy);
472 static inline const char*
500 pthread_mutex_lock(&pool_lock->
lock);
502 pthread_mutex_unlock(&pool_lock->
lock);
516 if (max_socket_idle == 0 && sock->
ctx) {
517 max_socket_idle = 55;
520 if (max_socket_idle > 0) {
521 sock->
idle_check.max_socket_idle = max_socket_idle;
522 sock->
idle_check.last_used = (uint32_t)cf_get_seconds();
529 pthread_mutex_lock(&pool_lock->
lock);
531 pthread_mutex_unlock(&pool_lock->
lock);
535 pthread_mutex_lock(&pool_lock->
lock);
537 pthread_mutex_unlock(&pool_lock->
lock);