MySQL 8.0.29
Source Code Documentation
server_struct.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 2021, 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 also distributed 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 included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef SERVER_STRUCT_H
24#define SERVER_STRUCT_H
25
26#include "xcom/task.h"
27#include "xcom/xcom_common.h"
28#include "xcom/xcom_limits.h"
29
30struct srv_buf {
33 char buf[0x10000];
34};
35typedef struct srv_buf srv_buf;
36
37/* Server definition */
38struct server {
40 int refcnt;
41 char *srv; /* Server name */
42 xcom_port port; /* Port */
43 connection_descriptor *con; /* Descriptor for open connection */
44 double active; /* Last activity */
45 double detected; /* Last incoming */
46 channel outgoing; /* Outbound messages */
47 task_env *sender; /* The sender task */
48 task_env *reply_handler; /* The reply task */
51 int number_of_pings_received; /* Number of pings received from this server */
52 double last_ping_received; /* Last received ping timestamp */
53#if defined(_WIN32)
54 bool reconnect; /*States if the server should be reconnected*/
55#endif
56};
57
58typedef struct server server;
59
60#endif
static int reconnect(void)
Definition: mysql.cc:3024
Definition: buf0block_hint.cc:29
Definition: task.h:426
Definition: node_connection.h:46
Definition: server_struct.h:38
int garbage
Definition: server_struct.h:39
char * srv
Definition: server_struct.h:41
double last_ping_received
Definition: server_struct.h:52
task_env * sender
Definition: server_struct.h:47
channel outgoing
Definition: server_struct.h:46
double active
Definition: server_struct.h:44
srv_buf out_buf
Definition: server_struct.h:49
task_env * reply_handler
Definition: server_struct.h:48
connection_descriptor * con
Definition: server_struct.h:43
double detected
Definition: server_struct.h:45
xcom_port port
Definition: server_struct.h:42
int invalid
Definition: server_struct.h:50
int number_of_pings_received
Definition: server_struct.h:51
int refcnt
Definition: server_struct.h:40
Definition: server_struct.h:30
u_int n
Definition: server_struct.h:32
u_int start
Definition: server_struct.h:31
Definition: task.h:241
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:72
unsigned short xcom_port
Definition: xcom_common.h:45