MySQL  8.0.16
Source Code Documentation
Vio Struct Reference

#include <violite.h>

Public Member Functions

 Vio (const Vio &)=delete
 
Viooperator= (const Vio &)=delete
 
Viooperator= (Vio &&vio)
 

Public Attributes

MYSQL_SOCKET mysql_socket
 
bool localhost = {false}
 
enum_vio_type type = {NO_VIO_TYPE}
 
int read_timeout = {-1}
 
int write_timeout = {-1}
 
int retry_count = {1}
 
bool inactive = {false}
 
struct sockaddr_storage local
 
struct sockaddr_storage remote
 
size_t addrLen = {0}
 
char * read_buffer = {nullptr}
 
char * read_pos = {nullptr}
 
char * read_end = {nullptr}
 
my_thread_t thread_id = {0}
 
sigset_t signal_mask
 
std::atomic_flag poll_shutdown_flag = ATOMIC_FLAG_INIT
 
void(* viodelete )(MYSQL_VIO) = {nullptr}
 
int(* vioerrno )(MYSQL_VIO) = {nullptr}
 
size_t(* read )(MYSQL_VIO, uchar *, size_t) = {nullptr}
 
size_t(* write )(MYSQL_VIO, const uchar *, size_t) = {nullptr}
 
int(* timeout )(MYSQL_VIO, uint, bool) = {nullptr}
 
int(* viokeepalive )(MYSQL_VIO, bool) = {nullptr}
 
int(* fastsend )(MYSQL_VIO) = {nullptr}
 
bool(* peer_addr )(MYSQL_VIO, char *, uint16 *, size_t) = {nullptr}
 
void(* in_addr )(MYSQL_VIO, struct sockaddr_storage *) = {nullptr}
 
bool(* should_retry )(MYSQL_VIO) = {nullptr}
 
bool(* was_timeout )(MYSQL_VIO) = {nullptr}
 
int(* vioshutdown )(MYSQL_VIO) = {nullptr}
 
bool(* is_connected )(MYSQL_VIO) = {nullptr}
 
bool(* has_data )(MYSQL_VIO) = {nullptr}
 
int(* io_wait )(MYSQL_VIO, enum enum_vio_io_event, int) = {nullptr}
 
bool(* connect )(MYSQL_VIO, struct sockaddr *, socklen_t, int) = {nullptr}
 
bool(* is_blocking )(Vio *vio) = {nullptr}
 
int(* set_blocking )(Vio *vio, bool val) = {nullptr}
 
int(* set_blocking_flag )(Vio *vio, bool val) = {nullptr}
 
bool is_blocking_flag = {true}
 

Private Member Functions

 Vio (uint flags)
 
 ~Vio ()
 

Friends

Viointernal_vio_create (uint flags)
 
void internal_vio_delete (Vio *vio)
 
bool vio_reset (Vio *vio, enum_vio_type type, my_socket sd, void *ssl, uint flags)
 Reinitialize an existing Vio object. More...
 

Constructor & Destructor Documentation

◆ Vio() [1/2]

Vio::Vio ( uint  flags)
explicitprivate

◆ ~Vio()

Vio::~Vio ( )
private

◆ Vio() [2/2]

Vio::Vio ( const Vio )
delete

Member Function Documentation

◆ operator=() [1/2]

Vio& Vio::operator= ( const Vio )
delete

◆ operator=() [2/2]

Vio & Vio::operator= ( Vio &&  vio)

Friends And Related Function Documentation

◆ internal_vio_create

Vio* internal_vio_create ( uint  flags)
friend

◆ internal_vio_delete

void internal_vio_delete ( Vio vio)
friend

◆ vio_reset

bool vio_reset ( Vio vio,
enum_vio_type  type,
my_socket  sd,
void *  ssl,
uint  flags 
)
friend

Reinitialize an existing Vio object.

Remarks
Used to rebind an initialized socket-based Vio object to another socket-based transport type. For example, rebind a TCP/IP transport to SSL.
If new socket handle passed to vio_reset() is not equal to the socket handle stored in Vio then socket handle will be closed before storing new value. If handles are equal then old socket is not closed. This is important for vio_reset() usage in ssl_do().
If any error occurs then Vio members won't be altered thus preserving socket handle stored in Vio and not taking ownership over socket handle passed as parameter.
Parameters
vioA VIO object.
typeA socket-based transport type.
sdThe socket.
sslAn optional SSL structure.
flagsFlags passed to new_vio.
Returns
Return value is zero on success.

Member Data Documentation

◆ addrLen

size_t Vio::addrLen = {0}

◆ connect

bool(* Vio::connect) (MYSQL_VIO, struct sockaddr *, socklen_t, int) = {nullptr}

◆ fastsend

int(* Vio::fastsend) (MYSQL_VIO) = {nullptr}

◆ has_data

bool(* Vio::has_data) (MYSQL_VIO) = {nullptr}

◆ in_addr

void(* Vio::in_addr) (MYSQL_VIO, struct sockaddr_storage *) = {nullptr}

◆ inactive

bool Vio::inactive = {false}

◆ io_wait

int(* Vio::io_wait) (MYSQL_VIO, enum enum_vio_io_event, int) = {nullptr}

◆ is_blocking

bool(* Vio::is_blocking) (Vio *vio) = {nullptr}

◆ is_blocking_flag

bool Vio::is_blocking_flag = {true}

◆ is_connected

bool(* Vio::is_connected) (MYSQL_VIO) = {nullptr}

◆ local

struct sockaddr_storage Vio::local

◆ localhost

bool Vio::localhost = {false}

◆ mysql_socket

MYSQL_SOCKET Vio::mysql_socket

◆ peer_addr

bool(* Vio::peer_addr) (MYSQL_VIO, char *, uint16 *, size_t) = {nullptr}

◆ poll_shutdown_flag

std::atomic_flag Vio::poll_shutdown_flag = ATOMIC_FLAG_INIT

◆ read

size_t(* Vio::read) (MYSQL_VIO, uchar *, size_t) = {nullptr}

◆ read_buffer

char* Vio::read_buffer = {nullptr}

◆ read_end

char* Vio::read_end = {nullptr}

◆ read_pos

char* Vio::read_pos = {nullptr}

◆ read_timeout

int Vio::read_timeout = {-1}

◆ remote

struct sockaddr_storage Vio::remote

◆ retry_count

int Vio::retry_count = {1}

◆ set_blocking

int(* Vio::set_blocking) (Vio *vio, bool val) = {nullptr}

◆ set_blocking_flag

int(* Vio::set_blocking_flag) (Vio *vio, bool val) = {nullptr}

◆ should_retry

bool(* Vio::should_retry) (MYSQL_VIO) = {nullptr}

◆ signal_mask

sigset_t Vio::signal_mask

◆ thread_id

my_thread_t Vio::thread_id = {0}

◆ timeout

int(* Vio::timeout) (MYSQL_VIO, uint, bool) = {nullptr}

◆ type

enum_vio_type Vio::type = {NO_VIO_TYPE}

◆ viodelete

void(* Vio::viodelete) (MYSQL_VIO) = {nullptr}

◆ vioerrno

int(* Vio::vioerrno) (MYSQL_VIO) = {nullptr}

◆ viokeepalive

int(* Vio::viokeepalive) (MYSQL_VIO, bool) = {nullptr}

◆ vioshutdown

int(* Vio::vioshutdown) (MYSQL_VIO) = {nullptr}

◆ was_timeout

bool(* Vio::was_timeout) (MYSQL_VIO) = {nullptr}

◆ write

size_t(* Vio::write) (MYSQL_VIO, const uchar *, size_t) = {nullptr}

◆ write_timeout

int Vio::write_timeout = {-1}

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