47#ifdef WIN32_LEAN_AND_MEAN
53#include <netinet/in.h>
61#if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
66#ifndef PSI_SOCKET_CALL
67#define PSI_SOCKET_CALL(M) psi_socket_service->M
80#ifdef HAVE_PSI_SOCKET_INTERFACE
81#define mysql_socket_register(P1, P2, P3) \
82 inline_mysql_socket_register(P1, P2, P3)
84#define mysql_socket_register(P1, P2, P3) \
101 const struct sockaddr *addr [[maybe_unused]],
102 socklen_t addr_len [[maybe_unused]]
105#ifdef HAVE_PSI_SOCKET_INTERFACE
106 if (
socket.m_psi !=
nullptr) {
124#ifdef HAVE_PSI_SOCKET_INTERFACE
125 if (
socket.m_psi !=
nullptr) {
138 return mysql_socket.
fd;
149 if (
likely(mysql_socket !=
nullptr)) {
150 mysql_socket->
fd = fd;
164#ifdef HAVE_PSI_SOCKET_INTERFACE
165#define MYSQL_SOCKET_WAIT_VARIABLES(LOCKER, STATE) \
166 struct PSI_socket_locker *LOCKER; \
167 PSI_socket_locker_state STATE;
169#define MYSQL_SOCKET_WAIT_VARIABLES(LOCKER, STATE)
183#ifdef HAVE_PSI_SOCKET_INTERFACE
184#define MYSQL_START_SOCKET_WAIT(LOCKER, STATE, SOCKET, OP, COUNT) \
185 LOCKER = inline_mysql_start_socket_wait(STATE, SOCKET, OP, COUNT, __FILE__, \
188#define MYSQL_START_SOCKET_WAIT(LOCKER, STATE, SOCKET, OP, COUNT) \
201#ifdef HAVE_PSI_SOCKET_INTERFACE
202#define MYSQL_END_SOCKET_WAIT(LOCKER, COUNT) \
203 inline_mysql_end_socket_wait(LOCKER, COUNT)
205#define MYSQL_END_SOCKET_WAIT(LOCKER, COUNT) \
217#ifdef HAVE_PSI_SOCKET_INTERFACE
218#define MYSQL_SOCKET_SET_STATE(SOCKET, STATE) \
219 inline_mysql_socket_set_state(SOCKET, STATE)
221#define MYSQL_SOCKET_SET_STATE(SOCKET, STATE) \
226#ifdef HAVE_PSI_SOCKET_INTERFACE
235 if (mysql_socket.
m_psi !=
nullptr) {
239 state, mysql_socket.
m_psi, op, byte_count, src_file, src_line);
253 if (locker !=
nullptr) {
266 if (
socket.m_psi !=
nullptr) {
283#ifdef HAVE_PSI_SOCKET_INTERFACE
284#define mysql_socket_socket(K, D, T, P) inline_mysql_socket_socket(K, D, T, P)
286#define mysql_socket_socket(K, D, T, P) inline_mysql_socket_socket(D, T, P)
297#ifdef HAVE_PSI_SOCKET_INTERFACE
298#define mysql_socket_bind(FD, AP, L) \
299 inline_mysql_socket_bind(__FILE__, __LINE__, FD, AP, L)
301#define mysql_socket_bind(FD, AP, L) inline_mysql_socket_bind(FD, AP, L)
312#ifdef HAVE_PSI_SOCKET_INTERFACE
313#define mysql_socket_getsockname(FD, AP, LP) \
314 inline_mysql_socket_getsockname(__FILE__, __LINE__, FD, AP, LP)
316#define mysql_socket_getsockname(FD, AP, LP) \
317 inline_mysql_socket_getsockname(FD, AP, LP)
328#ifdef HAVE_PSI_SOCKET_INTERFACE
329#define mysql_socket_connect(FD, AP, L) \
330 inline_mysql_socket_connect(__FILE__, __LINE__, FD, AP, L)
332#define mysql_socket_connect(FD, AP, L) inline_mysql_socket_connect(FD, AP, L)
343#ifdef HAVE_PSI_SOCKET_INTERFACE
344#define mysql_socket_getpeername(FD, AP, LP) \
345 inline_mysql_socket_getpeername(__FILE__, __LINE__, FD, AP, LP)
347#define mysql_socket_getpeername(FD, AP, LP) \
348 inline_mysql_socket_getpeername(FD, AP, LP)
360#ifdef HAVE_PSI_SOCKET_INTERFACE
361#define mysql_socket_send(FD, B, N, FL) \
362 inline_mysql_socket_send(__FILE__, __LINE__, FD, B, N, FL)
364#define mysql_socket_send(FD, B, N, FL) inline_mysql_socket_send(FD, B, N, FL)
376#ifdef HAVE_PSI_SOCKET_INTERFACE
377#define mysql_socket_recv(FD, B, N, FL) \
378 inline_mysql_socket_recv(__FILE__, __LINE__, FD, B, N, FL)
380#define mysql_socket_recv(FD, B, N, FL) inline_mysql_socket_recv(FD, B, N, FL)
394#ifdef HAVE_PSI_SOCKET_INTERFACE
395#define mysql_socket_sendto(FD, B, N, FL, AP, L) \
396 inline_mysql_socket_sendto(__FILE__, __LINE__, FD, B, N, FL, AP, L)
398#define mysql_socket_sendto(FD, B, N, FL, AP, L) \
399 inline_mysql_socket_sendto(FD, B, N, FL, AP, L)
413#ifdef HAVE_PSI_SOCKET_INTERFACE
414#define mysql_socket_recvfrom(FD, B, N, FL, AP, LP) \
415 inline_mysql_socket_recvfrom(__FILE__, __LINE__, FD, B, N, FL, AP, LP)
417#define mysql_socket_recvfrom(FD, B, N, FL, AP, LP) \
418 inline_mysql_socket_recvfrom(FD, B, N, FL, AP, LP)
431#ifdef HAVE_PSI_SOCKET_INTERFACE
432#define mysql_socket_getsockopt(FD, LV, ON, OP, OL) \
433 inline_mysql_socket_getsockopt(__FILE__, __LINE__, FD, LV, ON, OP, OL)
435#define mysql_socket_getsockopt(FD, LV, ON, OP, OL) \
436 inline_mysql_socket_getsockopt(FD, LV, ON, OP, OL)
449#ifdef HAVE_PSI_SOCKET_INTERFACE
450#define mysql_socket_setsockopt(FD, LV, ON, OP, OL) \
451 inline_mysql_socket_setsockopt(__FILE__, __LINE__, FD, LV, ON, OP, OL)
453#define mysql_socket_setsockopt(FD, LV, ON, OP, OL) \
454 inline_mysql_socket_setsockopt(FD, LV, ON, OP, OL)
462#ifdef HAVE_PSI_SOCKET_INTERFACE
463#define mysql_sock_set_nonblocking(FD) \
464 inline_mysql_sock_set_nonblocking(__FILE__, __LINE__, FD)
466#define mysql_sock_set_nonblocking(FD) inline_mysql_sock_set_nonblocking(FD)
476#ifdef HAVE_PSI_SOCKET_INTERFACE
477#define mysql_socket_listen(FD, N) \
478 inline_mysql_socket_listen(__FILE__, __LINE__, FD, N)
480#define mysql_socket_listen(FD, N) inline_mysql_socket_listen(FD, N)
493#ifdef HAVE_PSI_SOCKET_INTERFACE
494#define mysql_socket_accept(K, FD, AP, LP) \
495 inline_mysql_socket_accept(__FILE__, __LINE__, K, FD, AP, LP)
497#define mysql_socket_accept(K, FD, AP, LP) \
498 inline_mysql_socket_accept(FD, AP, LP)
507#ifdef HAVE_PSI_SOCKET_INTERFACE
508#define mysql_socket_close(FD) inline_mysql_socket_close(__FILE__, __LINE__, FD)
510#define mysql_socket_close(FD) inline_mysql_socket_close(FD)
520#ifdef HAVE_PSI_SOCKET_INTERFACE
521#define mysql_socket_shutdown(FD, H) \
522 inline_mysql_socket_shutdown(__FILE__, __LINE__, FD, H)
524#define mysql_socket_shutdown(FD, H) inline_mysql_socket_shutdown(FD, H)
527#ifdef HAVE_PSI_SOCKET_INTERFACE
541 int domain,
int type,
int protocol) {
545#ifdef HAVE_PSI_SOCKET_INTERFACE
558 const char *src_file, uint src_line,
563#ifdef HAVE_PSI_SOCKET_INTERFACE
564 if (mysql_socket.m_psi !=
nullptr) {
565 if (mysql_socket.m_psi->m_enabled) {
569 locker =
PSI_SOCKET_CALL(start_socket_wait)(&state, mysql_socket.m_psi,
577 if (locker !=
nullptr) {
583 (mysql_socket.m_psi,
nullptr, addr, len);
594#ifdef HAVE_PSI_SOCKET_INTERFACE
595 if ((mysql_socket.m_psi !=
nullptr) && (
result == 0)) {
596 PSI_SOCKET_CALL(set_socket_info)(mysql_socket.m_psi,
nullptr, addr, len);
607 const char *src_file, uint src_line,
612#ifdef HAVE_PSI_SOCKET_INTERFACE
613 if (mysql_socket.m_psi !=
nullptr) {
614 if (mysql_socket.m_psi->m_enabled) {
618 locker =
PSI_SOCKET_CALL(start_socket_wait)(&state, mysql_socket.m_psi,
626 if (locker !=
nullptr) {
645 const char *src_file, uint src_line,
650#ifdef HAVE_PSI_SOCKET_INTERFACE
651 if (mysql_socket.m_psi !=
nullptr) {
652 if (mysql_socket.m_psi->m_enabled) {
656 locker =
PSI_SOCKET_CALL(start_socket_wait)(&state, mysql_socket.m_psi,
664 if (locker !=
nullptr) {
683 const char *src_file, uint src_line,
688#ifdef HAVE_PSI_SOCKET_INTERFACE
689 if (mysql_socket.m_psi !=
nullptr) {
690 if (mysql_socket.m_psi->m_enabled) {
694 locker =
PSI_SOCKET_CALL(start_socket_wait)(&state, mysql_socket.m_psi,
702 if (locker !=
nullptr) {
721 const char *src_file, uint src_line,
726#ifdef HAVE_PSI_SOCKET_INTERFACE
727 if (mysql_socket.m_psi !=
nullptr) {
728 if (mysql_socket.m_psi->m_enabled) {
739 if (locker !=
nullptr) {
740 size_t bytes_written;
760 const char *src_file, uint src_line,
765#ifdef HAVE_PSI_SOCKET_INTERFACE
766 if (mysql_socket.m_psi !=
nullptr) {
767 if (mysql_socket.m_psi->m_enabled) {
771 locker =
PSI_SOCKET_CALL(start_socket_wait)(&state, mysql_socket.m_psi,
779 if (locker !=
nullptr) {
800 const char *src_file, uint src_line,
803 const struct sockaddr *addr, socklen_t addr_len) {
806#ifdef HAVE_PSI_SOCKET_INTERFACE
807 if (mysql_socket.m_psi !=
nullptr) {
808 if (mysql_socket.m_psi->m_enabled) {
820 if (locker !=
nullptr) {
821 size_t bytes_written;
833 sendto(mysql_socket.fd,
buf,
IF_WIN((
int), )
n,
flags, addr, addr_len);
842 const char *src_file, uint src_line,
845 struct sockaddr *addr, socklen_t *addr_len) {
848#ifdef HAVE_PSI_SOCKET_INTERFACE
849 if (mysql_socket.m_psi !=
nullptr) {
850 if (mysql_socket.m_psi->m_enabled) {
854 locker =
PSI_SOCKET_CALL(start_socket_wait)(&state, mysql_socket.m_psi,
863 if (locker !=
nullptr) {
876 recvfrom(mysql_socket.fd,
buf,
IF_WIN((
int), )
n,
flags, addr, addr_len);
885 const char *src_file, uint src_line,
891#ifdef HAVE_PSI_SOCKET_INTERFACE
892 if (mysql_socket.m_psi !=
nullptr) {
893 if (mysql_socket.m_psi->m_enabled) {
897 locker =
PSI_SOCKET_CALL(start_socket_wait)(&state, mysql_socket.m_psi,
905 if (locker !=
nullptr) {
924 const char *src_file, uint src_line,
930#ifdef HAVE_PSI_SOCKET_INTERFACE
931 if (mysql_socket.m_psi !=
nullptr) {
932 if (mysql_socket.m_psi->m_enabled) {
936 locker =
PSI_SOCKET_CALL(start_socket_wait)(&state, mysql_socket.m_psi,
944 if (locker !=
nullptr) {
965 ret = ioctlsocket(fd, FIONBIO, &nonblocking);
970 fd_flags =
fcntl(fd, F_GETFL, 0);
974#if defined(O_NONBLOCK)
975 fd_flags |= O_NONBLOCK;
976#elif defined(O_NDELAY)
977 fd_flags |= O_NDELAY;
978#elif defined(O_FNDELAY)
979 fd_flags |= O_FNDELAY;
981#error "No definition of non-blocking flag found."
983 if (
fcntl(fd, F_SETFL, fd_flags) == -1) {
995 const char *src_file, uint src_line,
1000#ifdef HAVE_PSI_SOCKET_INTERFACE
1001 if (mysql_socket.m_psi !=
nullptr) {
1002 if (mysql_socket.m_psi->m_enabled) {
1006 locker =
PSI_SOCKET_CALL(start_socket_wait)(&state, mysql_socket.m_psi,
1008 src_file, src_line);
1014 if (locker !=
nullptr) {
1033 const char *src_file, uint src_line,
1038#ifdef HAVE_PSI_SOCKET_INTERFACE
1039 if (mysql_socket.m_psi !=
nullptr) {
1040 if (mysql_socket.m_psi->m_enabled) {
1044 locker =
PSI_SOCKET_CALL(start_socket_wait)(&state, mysql_socket.m_psi,
1046 src_file, src_line);
1052 if (locker !=
nullptr) {
1075 socklen_t addr_length = (addr_len !=
nullptr) ? *addr_len : 0;
1077#ifdef HAVE_PSI_SOCKET_INTERFACE
1078 if (socket_listen.m_psi !=
nullptr) {
1079 if (socket_listen.m_psi->m_enabled) {
1083 locker =
PSI_SOCKET_CALL(start_socket_wait)(&state, socket_listen.m_psi,
1085 src_file, src_line);
1088 socket_accept.
fd =
accept(socket_listen.fd, addr, &addr_length);
1091 if (locker !=
nullptr) {
1102 return socket_accept;
1108 socket_accept.
fd =
accept(socket_listen.fd, addr, &addr_length);
1110#ifdef HAVE_PSI_SOCKET_INTERFACE
1118 return socket_accept;
1125 const char *src_file, uint src_line,
1130#ifdef HAVE_PSI_SOCKET_INTERFACE
1131 if (mysql_socket.m_psi !=
nullptr) {
1132 if (mysql_socket.m_psi->m_enabled) {
1136 locker =
PSI_SOCKET_CALL(start_socket_wait)(&state, mysql_socket.m_psi,
1138 src_file, src_line);
1144 if (locker !=
nullptr) {
1159#ifdef HAVE_PSI_SOCKET_INTERFACE
1161 if (mysql_socket.m_psi !=
nullptr) {
1173 const char *src_file, uint src_line,
1179 static LPFN_DISCONNECTEX DisconnectEx =
nullptr;
1180 if (DisconnectEx ==
nullptr) {
1181 DWORD dwBytesReturned;
1182 GUID guidDisconnectEx = WSAID_DISCONNECTEX;
1183 WSAIoctl(mysql_socket.fd, SIO_GET_EXTENSION_FUNCTION_POINTER,
1184 &guidDisconnectEx,
sizeof(GUID), &DisconnectEx,
1185 sizeof(DisconnectEx), &dwBytesReturned,
nullptr,
nullptr);
1190#ifdef HAVE_PSI_SOCKET_INTERFACE
1191 if (mysql_socket.m_psi !=
nullptr) {
1192 if (mysql_socket.m_psi->m_enabled) {
1202 result = (DisconnectEx(mysql_socket.fd, (LPOVERLAPPED)
nullptr,
1203 (DWORD)0, (DWORD)0) ==
TRUE)
1211 if (locker !=
nullptr) {
1223 result = (DisconnectEx(mysql_socket.fd, (LPOVERLAPPED)
nullptr, (DWORD)0,
#define PSI_SOCKET_CALL(M)
Definition: psi_socket.h:36
mysql_service_status_t recv(const char *tag, const unsigned char *data, size_t data_length) noexcept
Definition: gr_message_service_example.cc:39
PSI_socket_operation
Operation performed on an instrumented socket.
Definition: psi_socket_bits.h:89
struct PSI_socket_locker PSI_socket_locker
Definition: psi_socket_bits.h:77
PSI_socket_state
State of an instrumented socket.
Definition: psi_socket_bits.h:80
unsigned int PSI_socket_key
Instrumented socket key.
Definition: psi_socket_bits.h:49
@ PSI_SOCKET_CLOSE
Socket close, as in shutdown().
Definition: psi_socket_bits.h:97
@ PSI_SOCKET_SEND
Socket send, send().
Definition: psi_socket_bits.h:99
@ PSI_SOCKET_RECV
Socket receive, recv().
Definition: psi_socket_bits.h:101
@ PSI_SOCKET_BIND
Socket bind, as in bind(), getsockname() and getpeername().
Definition: psi_socket_bits.h:95
@ PSI_SOCKET_CONNECT
Socket connection, as in connect(), listen() and accept().
Definition: psi_socket_bits.h:93
@ PSI_SOCKET_SHUTDOWN
Socket shutdown, as in shutdown().
Definition: psi_socket_bits.h:117
@ PSI_SOCKET_OPT
Socket options, as in getsockopt() and setsockopt().
Definition: psi_socket_bits.h:113
static int inline_mysql_socket_getsockopt(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket, int level, int optname, SOCKBUF_T *optval, socklen_t *optlen)
mysql_socket_getsockopt
Definition: mysql_socket.h:883
static void inline_mysql_end_socket_wait(struct PSI_socket_locker *locker, size_t byte_count)
Instrumentation calls for MYSQL_END_SOCKET_WAIT.
Definition: mysql_socket.h:251
static ssize_t inline_mysql_socket_sendto(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket, const SOCKBUF_T *buf, size_t n, int flags, const struct sockaddr *addr, socklen_t addr_len)
mysql_socket_sendto
Definition: mysql_socket.h:798
static int inline_mysql_socket_getpeername(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket, struct sockaddr *addr, socklen_t *len)
mysql_socket_getpeername
Definition: mysql_socket.h:681
static int inline_mysql_socket_bind(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket, const struct sockaddr *addr, socklen_t len)
mysql_socket_bind
Definition: mysql_socket.h:556
static int inline_mysql_socket_setsockopt(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket, int level, int optname, const SOCKBUF_T *optval, socklen_t optlen)
mysql_socket_setsockopt
Definition: mysql_socket.h:922
static struct PSI_socket_locker * inline_mysql_start_socket_wait(PSI_socket_locker_state *state, MYSQL_SOCKET mysql_socket, enum PSI_socket_operation op, size_t byte_count, const char *src_file, int src_line)
Instrumentation calls for MYSQL_START_SOCKET_WAIT.
Definition: mysql_socket.h:231
static int inline_mysql_sock_set_nonblocking(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket)
mysql_socket_set_nonblocking
Definition: mysql_socket.h:993
static void inline_mysql_socket_register(const char *category, PSI_socket_info *info, int count)
Definition: mysql_socket.h:528
static ssize_t inline_mysql_socket_recv(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket, SOCKBUF_T *buf, size_t n, int flags)
mysql_socket_recv
Definition: mysql_socket.h:758
static MYSQL_SOCKET inline_mysql_socket_socket(PSI_socket_key key, int domain, int type, int protocol)
mysql_socket_socket
Definition: mysql_socket.h:537
static int inline_mysql_socket_shutdown(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket, int how)
mysql_socket_shutdown
Definition: mysql_socket.h:1171
static void mysql_socket_setfd(MYSQL_SOCKET *mysql_socket, my_socket fd)
MYSQL_SOCKET helper.
Definition: mysql_socket.h:147
static int set_socket_nonblock(my_socket fd)
set_socket_nonblock
Definition: mysql_socket.h:960
static MYSQL_SOCKET inline_mysql_socket_accept(const char *src_file, uint src_line, PSI_socket_key key, MYSQL_SOCKET socket_listen, struct sockaddr *addr, socklen_t *addr_len)
mysql_socket_accept
Definition: mysql_socket.h:1069
static void mysql_socket_set_thread_owner(MYSQL_SOCKET socket)
Assign the current thread instrumentation to the socket.
Definition: mysql_socket.h:117
static ssize_t inline_mysql_socket_send(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket, const SOCKBUF_T *buf, size_t n, int flags)
mysql_socket_send
Definition: mysql_socket.h:719
static void inline_mysql_socket_set_state(MYSQL_SOCKET socket, enum PSI_socket_state state)
Set the state (IDLE, ACTIVE) of an instrumented socket.
Definition: mysql_socket.h:264
static ssize_t inline_mysql_socket_recvfrom(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket, SOCKBUF_T *buf, size_t n, int flags, struct sockaddr *addr, socklen_t *addr_len)
mysql_socket_recvfrom
Definition: mysql_socket.h:840
static void mysql_socket_set_address(MYSQL_SOCKET socket, const struct sockaddr *addr, socklen_t addr_len)
Set socket descriptor and address.
Definition: mysql_socket.h:96
static int inline_mysql_socket_getsockname(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket, struct sockaddr *addr, socklen_t *len)
mysql_socket_getsockname
Definition: mysql_socket.h:605
static int inline_mysql_socket_connect(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket, const struct sockaddr *addr, socklen_t len)
mysql_socket_connect
Definition: mysql_socket.h:643
static int inline_mysql_socket_close(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket)
mysql_socket_close
Definition: mysql_socket.h:1123
static my_socket mysql_socket_getfd(MYSQL_SOCKET mysql_socket)
MYSQL_SOCKET helper.
Definition: mysql_socket.h:137
static int inline_mysql_socket_listen(const char *src_file, uint src_line, MYSQL_SOCKET mysql_socket, int backlog)
mysql_socket_listen
Definition: mysql_socket.h:1031
static int flags[50]
Definition: hp_test1.cc:40
mysql_service_status_t send(const char *tag, const unsigned char *data, const size_t data_length) noexcept
Definition: message_service.cc:33
Header for compiler-dependent features.
constexpr bool likely(bool expr)
Definition: my_compiler.h:57
Common #defines and includes for file and socket I/O.
#define INVALID_SOCKET
Definition: my_io.h:190
#define closesocket(A)
Definition: my_io.h:178
#define IF_WIN(A, B)
Definition: my_macros.h:38
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
#define HAVE_PSI_SOCKET_INTERFACE
Definition: my_psi_config.h:199
static int count
Definition: myisam_ftdump.cc:45
int my_socket
Definition: mysql.h:65
#define SOCKBUF_T
Definition: mysql_socket.h:55
#define MYSQL_INVALID_SOCKET
MYSQL_SOCKET initial value.
Definition: mysql_socket_bits.h:52
Definition: buf0block_hint.cc:30
MYSQL_STRINGS_EXPORT void shutdown()
Shutdown character set/collation library.
Definition: collations.cc:105
stdx::expected< int, std::error_code > fcntl(file_handle_type fd, const FileControlOption &cmd)
Definition: file.h:125
stdx::expected< void, error_type > listen(native_handle_type native_handle, int backlog)
Definition: socket.h:149
stdx::expected< void, error_type > getsockname(native_handle_type native_handle, struct sockaddr *addr, size_t *addr_len)
Definition: socket.h:402
stdx::expected< native_handle_type, error_type > socket(int family, int sock_type, int protocol)
Definition: socket.h:63
stdx::expected< void, error_type > bind(native_handle_type native_handle, const struct sockaddr *addr, size_t addr_len)
wrap bind() in a portable way.
Definition: socket.h:339
stdx::expected< void, error_type > getpeername(native_handle_type native_handle, struct sockaddr *addr, size_t *addr_len)
Definition: socket.h:423
stdx::expected< native_handle_type, error_type > accept(native_handle_type native_handle, struct sockaddr *addr, socklen_t *addr_len)
wrap accept() in a portable way.
Definition: socket.h:367
stdx::expected< void, error_type > setsockopt(native_handle_type native_handle, int level, int optname, const void *optval, socklen_t optlen)
Definition: socket.h:158
stdx::expected< void, error_type > connect(native_handle_type native_handle, const struct sockaddr *addr, size_t addr_len)
wrap connect() in a portable way.
Definition: socket.h:353
stdx::expected< void, error_type > getsockopt(native_handle_type native_handle, int level, int optname, void *optval, socklen_t *optlen)
Definition: socket.h:174
static const char * category
Definition: sha2_password.cc:170
Performance schema instrumentation (declarations).
struct result result
Definition: result.h:34
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:60
required string type
Definition: replication_group_member_actions.proto:34
struct sockaddr sockaddr
Definition: sock_probe_win32.h:63
An instrumented socket.
Definition: mysql_socket_bits.h:35
struct PSI_socket * m_psi
The instrumentation hook.
Definition: mysql_socket_bits.h:44
my_socket fd
The real socket descriptor.
Definition: mysql_socket_bits.h:37
bool m_enabled
Instrumentation is enabled.
Definition: psi_bits.h:191
Socket instrument information.
Definition: psi_socket_bits.h:128
State data storage for start_socket_wait_v1_t.
Definition: psi_socket_bits.h:158
__u_long u_long
Definition: types.h:74
#define TRUE
Definition: types.h:51
int n
Definition: xcom_base.cc:509