MySQL 8.4.2
Source Code Documentation
server_struct.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef SERVER_STRUCT_H
25#define SERVER_STRUCT_H
26
27#include "xcom/task.h"
28#include "xcom/xcom_common.h"
29#include "xcom/xcom_limits.h"
30
31struct srv_buf {
34 char buf[0x10000];
35};
36typedef struct srv_buf srv_buf;
37
38/* Server definition */
39struct server {
41 int refcnt;
42 char *srv; /* Server name */
43 xcom_port port; /* Port */
44 connection_descriptor *con; /* Descriptor for open connection */
45 double active; /* Last activity */
46 double detected; /* Last incoming */
47 channel outgoing; /* Outbound messages */
48 task_env *sender; /* The sender task */
49 task_env *reply_handler; /* The reply task */
52 int number_of_pings_received; /* Number of pings received from this server */
53 double last_ping_received; /* Last received ping timestamp */
54#if defined(_WIN32)
55 bool reconnect; /*States if the server should be reconnected*/
56#endif
57};
58
59typedef struct server server;
60
61#endif
static int reconnect()
Definition: mysql.cc:3358
Definition: buf0block_hint.cc:30
Definition: task.h:427
Definition: node_connection.h:47
Definition: server_struct.h:39
int garbage
Definition: server_struct.h:40
char * srv
Definition: server_struct.h:42
double last_ping_received
Definition: server_struct.h:53
task_env * sender
Definition: server_struct.h:48
channel outgoing
Definition: server_struct.h:47
double active
Definition: server_struct.h:45
srv_buf out_buf
Definition: server_struct.h:50
task_env * reply_handler
Definition: server_struct.h:49
connection_descriptor * con
Definition: server_struct.h:44
double detected
Definition: server_struct.h:46
xcom_port port
Definition: server_struct.h:43
int invalid
Definition: server_struct.h:51
int number_of_pings_received
Definition: server_struct.h:52
int refcnt
Definition: server_struct.h:41
Definition: server_struct.h:31
u_int n
Definition: server_struct.h:33
u_int start
Definition: server_struct.h:32
Definition: task.h:242
Rudimentary task system in portable C, based on Tom Duff's switch-based coroutine trick and a stack o...
__u_int u_int
Definition: types.h:73
unsigned short xcom_port
Definition: xcom_common.h:46