MySQL 8.0.39
Source Code Documentation
Unix_socket Class Reference

The Unix_socket class represents an abstraction for creating a unix socket ready to listen for new connections from clients. More...

Public Member Functions

 Unix_socket (const std::string *unix_sockname, uint backlog)
 Constructor that takes pathname for unix socket to bind to and backlog specifying the length of pending connection queue. More...
 
MYSQL_SOCKET get_listener_socket ()
 Set up a listener socket which is ready to listen for connection from clients. More...
 

Private Member Functions

bool create_lockfile ()
 Create a lockfile which contains the pid of the mysqld instance started and pathname as name of unix socket pathname appended with .lock. More...
 

Private Attributes

std::string m_unix_sockname
 
uint m_backlog
 

Detailed Description

The Unix_socket class represents an abstraction for creating a unix socket ready to listen for new connections from clients.

Constructor & Destructor Documentation

◆ Unix_socket()

Unix_socket::Unix_socket ( const std::string *  unix_sockname,
uint  backlog 
)
inline

Constructor that takes pathname for unix socket to bind to and backlog specifying the length of pending connection queue.

Parameters
unix_socknamepointer to pathname for the created unix socket to bind.
backlogspecifying the length of pending connection queue.

Member Function Documentation

◆ create_lockfile()

bool Unix_socket::create_lockfile ( )
private

Create a lockfile which contains the pid of the mysqld instance started and pathname as name of unix socket pathname appended with .lock.

Return values
Falseif lockfile creation is successful else true if lockfile file could not be created.

◆ get_listener_socket()

MYSQL_SOCKET Unix_socket::get_listener_socket ( )
inline

Set up a listener socket which is ready to listen for connection from clients.

Return values
validsocket if successful else MYSQL_INVALID_SOCKET on failure.

Member Data Documentation

◆ m_backlog

uint Unix_socket::m_backlog
private

◆ m_unix_sockname

std::string Unix_socket::m_unix_sockname
private

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