MySQL 9.0.0
Source Code Documentation
Xcom_network_provider_library Class Reference

#include <xcom_network_provider_native_lib.h>

Static Public Member Functions

static result checked_create_socket (int domain, int type, int protocol)
 
static struct addrinfo * does_node_have_v4_address (struct addrinfo *retrieved)
 Retrieves a node IPv4 address, if it exists. More...
 
static int timed_connect (int fd, struct sockaddr *sock_addr, socklen_t sock_size)
 
static int timed_connect_sec (int fd, struct sockaddr *sock_addr, socklen_t sock_size, int timeout)
 
static int timed_connect_msec (int fd, struct sockaddr *sock_addr, socklen_t sock_size, int timeout)
 
static int allowlist_socket_accept (int fd, site_def const *xcom_config)
 
static result gcs_shut_close_socket (int *sock)
 
static result announce_tcp (xcom_port port)
 
static bool poll_for_timed_connects (int fd, int timeout)
 Auxiliary method used in Synchronous connects in order to poll a connection for input, until a certain timeout is reached, and check all errors that might come out of the poll() call. More...
 
static bool verify_poll_errors (int fd, int sysret, struct pollfd &fds)
 After a poll call, this method will check for any errors that might have been returned from the poll itself. More...
 

Static Private Member Functions

static void init_server_addr (struct sockaddr **sock_addr, socklen_t *sock_len, xcom_port port, int family)
 Initializes a sockaddr prepared to be used in bind() More...
 
static result xcom_checked_socket (int domain, int type, int protocol)
 Wrapper function which retries and checks errors from socket. More...
 
static result create_server_socket ()
 
static result create_server_socket_v4 ()
 
static void gcs_shutdown_socket (int *sock)
 
static result gcs_close_socket (int *sock)
 

Member Function Documentation

◆ allowlist_socket_accept()

int Xcom_network_provider_library::allowlist_socket_accept ( int  fd,
site_def const *  xcom_config 
)
static

◆ announce_tcp()

result Xcom_network_provider_library::announce_tcp ( xcom_port  port)
static

◆ checked_create_socket()

result Xcom_network_provider_library::checked_create_socket ( int  domain,
int  type,
int  protocol 
)
static

◆ create_server_socket()

result Xcom_network_provider_library::create_server_socket ( )
staticprivate

◆ create_server_socket_v4()

result Xcom_network_provider_library::create_server_socket_v4 ( )
staticprivate

◆ does_node_have_v4_address()

struct addrinfo * Xcom_network_provider_library::does_node_have_v4_address ( struct addrinfo *  retrieved)
static

Retrieves a node IPv4 address, if it exists.

If a node is v4 reachable, means one of two:

  • The raw address is V4
  • a name was resolved to a V4/V6 address

If the later is the case, we are going to prefer the first v4 address in the list, since it is the common language between old and new version. If you want exclusive V6, please configure your DNS server to serve V6 names

Parameters
retrieveda previously retrieved struct addrinfo
Returns
struct addrinfo* An addrinfo of the first IPv4 address. Else it will return the entry parameter.

◆ gcs_close_socket()

result Xcom_network_provider_library::gcs_close_socket ( int *  sock)
staticprivate

◆ gcs_shut_close_socket()

result Xcom_network_provider_library::gcs_shut_close_socket ( int *  sock)
static

◆ gcs_shutdown_socket()

void Xcom_network_provider_library::gcs_shutdown_socket ( int *  sock)
staticprivate

◆ init_server_addr()

void Xcom_network_provider_library::init_server_addr ( struct sockaddr **  sock_addr,
socklen_t *  sock_len,
xcom_port  port,
int  family 
)
staticprivate

Initializes a sockaddr prepared to be used in bind()

Parameters
sock_addrstruct sockaddr out parameter. You will need to free it after being used.
sock_lensocklen_t out parameter. It will contain the length of sock_addr
portthe port to bind.
familythe address family

◆ poll_for_timed_connects()

bool Xcom_network_provider_library::poll_for_timed_connects ( int  fd,
int  timeout 
)
static

Auxiliary method used in Synchronous connects in order to poll a connection for input, until a certain timeout is reached, and check all errors that might come out of the poll() call.

Parameters
fdfile descriptor to poll
timeouttimeout (in msecs) to wait for activity in fd
Returns
true in case of any error, false otherwise.

◆ timed_connect()

int Xcom_network_provider_library::timed_connect ( int  fd,
struct sockaddr sock_addr,
socklen_t  sock_size 
)
static

◆ timed_connect_msec()

int Xcom_network_provider_library::timed_connect_msec ( int  fd,
struct sockaddr sock_addr,
socklen_t  sock_size,
int  timeout 
)
static

◆ timed_connect_sec()

int Xcom_network_provider_library::timed_connect_sec ( int  fd,
struct sockaddr sock_addr,
socklen_t  sock_size,
int  timeout 
)
static

◆ verify_poll_errors()

bool Xcom_network_provider_library::verify_poll_errors ( int  fd,
int  sysret,
struct pollfd fds 
)
static

After a poll call, this method will check for any errors that might have been returned from the poll itself.

Parameters
fdThe file descriptor being poll-ed
sysretReturn value from poll call
fdsstruct pollfd that contains fd used to call poll
Returns
true In case of error
false otherwise

◆ xcom_checked_socket()

result Xcom_network_provider_library::xcom_checked_socket ( int  domain,
int  type,
int  protocol 
)
staticprivate

Wrapper function which retries and checks errors from socket.


The documentation for this class was generated from the following files: