MySQL 8.4.2
Source Code Documentation
TCP_socket Class Reference

TCP_socket class represents the TCP sockets abstraction. More...

Public Member Functions

 TCP_socket (std::string bind_addr_str, std::string network_namespace_str, uint tcp_port, uint backlog, uint port_timeout)
 Constructor that takes tcp port and ip address string and other related parameters to set up listener tcp to listen for connection events. More...
 
MYSQL_SOCKET get_listener_socket ()
 Set up a listener to listen for connection events. More...
 

Private Member Functions

MYSQL_SOCKET create_socket (const struct addrinfo *addrinfo_list, int addr_family, struct addrinfo **use_addrinfo)
 

Private Attributes

std::string m_bind_addr_str
 
std::string m_network_namespace
 
uint m_tcp_port
 
uint m_backlog
 
uint m_port_timeout
 

Detailed Description

TCP_socket class represents the TCP sockets abstraction.

It provides the get_listener_socket that setup a TCP listener socket to listen.

Constructor & Destructor Documentation

◆ TCP_socket()

TCP_socket::TCP_socket ( std::string  bind_addr_str,
std::string  network_namespace_str,
uint  tcp_port,
uint  backlog,
uint  port_timeout 
)
inline

Constructor that takes tcp port and ip address string and other related parameters to set up listener tcp to listen for connection events.

Parameters
bind_addr_strip address as string value.
network_namespace_strnetwork namespace as string value
tcp_porttcp port number.
backlogbacklog specifying length of pending connection queue.
port_timeoutport timeout value

Member Function Documentation

◆ create_socket()

MYSQL_SOCKET TCP_socket::create_socket ( const struct addrinfo *  addrinfo_list,
int  addr_family,
struct addrinfo **  use_addrinfo 
)
inlineprivate

◆ get_listener_socket()

MYSQL_SOCKET TCP_socket::get_listener_socket ( )
inline

Set up a listener to listen for connection events.

Return values
validsocket if successful else MYSQL_INVALID_SOCKET on failure.

Member Data Documentation

◆ m_backlog

uint TCP_socket::m_backlog
private

◆ m_bind_addr_str

std::string TCP_socket::m_bind_addr_str
private

◆ m_network_namespace

std::string TCP_socket::m_network_namespace
private

◆ m_port_timeout

uint TCP_socket::m_port_timeout
private

◆ m_tcp_port

uint TCP_socket::m_tcp_port
private

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