![]() |
#include <aerospike/as_address.h>
#include <aerospike/as_error.h>
#include <citrusleaf/cf_clock.h>
#include <pthread.h>
#include <stddef.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <errno.h>
Go to the source code of this file.
Data Structures | |
struct | as_socket |
struct | as_tls_context |
Macros | |
#define | as_close(_fd) close((_fd)) |
#define | AS_CONNECTING EINPROGRESS |
#define | as_last_error() errno |
#define | as_socket_data_t void |
#define | as_socket_fd int |
#define | as_socket_size_t size_t |
#define | AS_WOULDBLOCK EWOULDBLOCK |
Functions | |
void | as_socket_close (as_socket *sock) |
static bool | as_socket_connect_fd (as_socket_fd fd, struct sockaddr *addr, socklen_t size) |
int | as_socket_create (as_socket *sock, int family, as_tls_context *ctx, const char *tls_name) |
as_status | as_socket_create_and_connect (as_socket *sock, as_error *err, struct sockaddr *addr, as_tls_context *ctx, const char *tls_name, uint64_t deadline_ms) |
int | as_socket_create_fd (int family, as_socket_fd *fdp) |
static bool | as_socket_current_tran (uint64_t last_used, uint64_t max_socket_idle_ns) |
static bool | as_socket_current_trim (uint64_t last_used, uint64_t max_socket_idle_ns) |
static uint64_t | as_socket_deadline (uint32_t timeout_ms) |
as_status | as_socket_error (as_socket_fd fd, struct as_node_s *node, as_error *err, as_status status, const char *msg, int code) |
void | as_socket_error_append (as_error *err, struct sockaddr *addr) |
static as_tls_context * | as_socket_get_tls_context (as_tls_context *ctx) |
void | as_socket_init (as_socket *sock) |
as_status | as_socket_read_deadline (as_error *err, as_socket *sock, struct as_node_s *node, uint8_t *buf, size_t buf_len, uint32_t socket_timeout, uint64_t deadline) |
bool | as_socket_start_connect (as_socket *sock, struct sockaddr *addr, uint64_t deadline_ms) |
static bool | as_socket_use_tls (as_tls_context *ctx) |
int | as_socket_validate_fd (as_socket_fd fd) |
bool | as_socket_wrap (as_socket *sock, int family, as_socket_fd fd, as_tls_context *ctx, const char *tls_name) |
as_status | as_socket_write_deadline (as_error *err, as_socket *sock, struct as_node_s *node, uint8_t *buf, size_t buf_len, uint32_t socket_timeout, uint64_t deadline) |
#define as_close | ( | _fd | ) | close((_fd)) |
Definition at line 37 of file as_socket.h.
#define AS_CONNECTING EINPROGRESS |
Definition at line 35 of file as_socket.h.
#define as_last_error | ( | ) | errno |
Definition at line 38 of file as_socket.h.
#define as_socket_data_t void |
Definition at line 33 of file as_socket.h.
#define as_socket_fd int |
Definition at line 32 of file as_socket.h.
#define as_socket_size_t size_t |
Definition at line 34 of file as_socket.h.
#define AS_WOULDBLOCK EWOULDBLOCK |
Definition at line 36 of file as_socket.h.
|
private |
Close and release resources associated with a as_socket.
|
inlinestaticprivate |
Connect to non-blocking socket.
Definition at line 152 of file as_socket.h.
References AS_CONNECTING, and as_last_error.
|
private |
Create non-blocking socket. Family should be AF_INET or AF_INET6. Return zero on success.
|
private |
Create non-blocking socket and connect.
|
private |
Create non-blocking socket. Family should be AF_INET or AF_INET6. Return zero on success.
|
inlinestaticprivate |
Is socket idle within limit for commands.
Definition at line 197 of file as_socket.h.
|
inlinestaticprivate |
Is socket idle within limit for trimming idle sockets in cluster tend thread.
Definition at line 207 of file as_socket.h.
|
inlinestaticprivate |
Calculate future deadline given timeout.
Definition at line 229 of file as_socket.h.
|
private |
Create error message for socket error.
|
private |
Append address to error message.
|
inlinestaticprivate |
Return TLS context only if exists and not for login only.
Definition at line 110 of file as_socket.h.
References as_tls_context::for_login_only.
|
private |
Read socket data with future deadline in milliseconds. If deadline is zero, do not set deadline.
|
private |
Connect to non-blocking socket and perform sync TLS connect if TLS enabled.
|
inlinestaticprivate |
Return true if TLS context exists and not TLS login only.
Definition at line 100 of file as_socket.h.
References as_tls_context::for_login_only.
|
private |
Peek for socket connection status using underlying fd. Needed to support libuv.
|
private |
Wrap existing fd in a socket. Family should be AF_INET or AF_INET6.