MySQL 8.3.0
Source Code Documentation
task_net.cc File Reference
#include "xcom/xcom_profile.h"
#include <netdb.h>
#include <sys/socket.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "xcom/simset.h"
#include "xcom/task.h"
#include "xcom/task_debug.h"
#include "xcom/task_os.h"
#include "xcom/x_platform.h"
#include "xcom/xcom_memory.h"
#include "xdr_gen/xcom_vp.h"

Classes

struct  infonode
 

Macros

#define STRING_PORT_SIZE   6
 
#define NR_GETADDRINFO_ATTEMPTS   10
 

Typedefs

typedef struct infonode infonode
 

Functions

int checked_getaddrinfo (const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res)
 Wrapper function which retries and checks errors from getaddrinfo. More...
 
int checked_getaddrinfo_port (const char *nodename, xcom_port port, const struct addrinfo *hints, struct addrinfo **res)
 Wrapper function to checked_getaddrinfo that accepts a numeric port. More...
 
void deinit_network_cache ()
 
int init_net ()
 
int deinit_net ()
 

Macro Definition Documentation

◆ NR_GETADDRINFO_ATTEMPTS

#define NR_GETADDRINFO_ATTEMPTS   10

◆ STRING_PORT_SIZE

#define STRING_PORT_SIZE   6

Typedef Documentation

◆ infonode

typedef struct infonode infonode

Function Documentation

◆ checked_getaddrinfo()

int checked_getaddrinfo ( const char *  nodename,
const char *  servname,
const struct addrinfo *  hints,
struct addrinfo **  res 
)

Wrapper function which retries and checks errors from getaddrinfo.

We have observed that getaddrinfo returns EAI_AGAIN when called with an unresolvable hostname on systems using systemd-resolved for DNS resolution. Therefore, we only attempt to resolve nodename up to NR_GETADDRINFO_ATTEMPTS times, to avoid getting stuck in an infinite loop.

◆ checked_getaddrinfo_port()

int checked_getaddrinfo_port ( const char *  nodename,
xcom_port  port,
const struct addrinfo *  hints,
struct addrinfo **  res 
)

Wrapper function to checked_getaddrinfo that accepts a numeric port.

◆ deinit_net()

int deinit_net ( )

◆ deinit_network_cache()

void deinit_network_cache ( )

◆ init_net()

int init_net ( )