#include <aerospike/as_error.h>
#include <citrusleaf/cf_clock.h>
#include <pthread.h>
#include <stddef.h>
#include <stdint.h>
#include <openssl/ssl.h>
#include <aerospike/as_config.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
Go to the source code of this file.
|
void | as_socket_close (as_socket *sock) |
|
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) |
|
int | as_socket_create_fd (int family) |
|
as_status | as_socket_error (int 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) |
|
void | as_socket_init (as_socket *sock) |
|
bool | as_socket_start_connect (as_socket *sock, struct sockaddr *addr) |
|
int | as_socket_validate (as_socket *sock) |
|
int | as_socket_validate_fd (int fd) |
|
bool | as_socket_wrap (as_socket *sock, int family, int fd, as_tls_context *ctx, const char *tls_name) |
|
#define as_close |
( |
|
fd) | |
(close(fd)) |
#define AS_IP_ADDRESS_SIZE 64 |
#define as_socket_data_t void |
#define as_socket_size_t size_t |
Close and release resources associated with a as_socket.
Create non-blocking socket. Family should be AF_INET or AF_INET6.
Create non-blocking socket and connect.
int as_socket_create_fd |
( |
int |
family) | |
|
|
private |
Create non-blocking socket. Family should be AF_INET or AF_INET6. If socket create fails, return -errno.
Create error message for socket error.
void as_socket_error_append |
( |
as_error * |
err, |
|
|
struct sockaddr * |
addr |
|
) |
| |
|
private |
Append address to error message.
bool as_socket_start_connect |
( |
as_socket * |
sock, |
|
|
struct sockaddr * |
addr |
|
) |
| |
|
private |
Connect to non-blocking socket.
Peek for socket connection status.
- Returns
- 0 : socket is connected, but no data available. > 0 : byte size of data available. < 0 : socket is invalid.
int as_socket_validate_fd |
( |
int |
fd) | |
|
|
private |
Peek for socket connection status using underlying fd. Needed to support libuv.
- Returns
- 0 : socket is connected, but no data available. > 0 : byte size of data available. < 0 : socket is invalid.
Wrap existing fd in a socket. Family should be AF_INET or AF_INET6.