MySQL 8.3.0
Source Code Documentation
task_net.h File Reference
#include "xcom/result.h"
#include "xcom/xcom_common.h"

Go to the source code of this file.

Functions

result xcom_checked_socket (int domain, int type, int protocol)
 
struct addrinfo * xcom_caching_getaddrinfo (char const *server)
 
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 ()
 

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 ( )

◆ xcom_caching_getaddrinfo()

struct addrinfo * xcom_caching_getaddrinfo ( char const *  server)

◆ xcom_checked_socket()

result xcom_checked_socket ( int  domain,
int  type,
int  protocol 
)