MySQL 8.4.2
Source Code Documentation
connection_handler.h
Go to the documentation of this file.
1#ifndef CONNECTION_HANDLER_INCLUDED
2#define CONNECTION_HANDLER_INCLUDED
3
4/* Copyright (c) 2007, 2024, Oracle and/or its affiliates.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License, version 2.0,
8 as published by the Free Software Foundation.
9
10 This program is designed to work with certain software (including
11 but not limited to OpenSSL) that is licensed under separate terms,
12 as designated in a particular file or component or in included license
13 documentation. The authors of MySQL hereby grant you an additional
14 permission to link the program and your derivative works with the
15 separately licensed software that they have either included with
16 the program or referenced in the documentation.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License, version 2.0, for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
26
27#include "my_inttypes.h"
28
29class THD;
30class Channel_info;
32
33/**
34 This abstract base class represents how connections are processed,
35 most importantly how they map to OS threads.
36*/
38 protected:
40
41 Connection_handler() = default;
42 virtual ~Connection_handler() = default;
43
44 /**
45 Add a connection.
46
47 @param channel_info Pointer to the Channel_info object.
48
49 @note If this function is successful (returns false), the ownership of
50 channel_info is transferred. Otherwise the caller is responsible for
51 its destruction.
52
53 @return true if processing of the new connection failed, false otherwise.
54 */
55 virtual bool add_connection(Channel_info *channel_info) = 0;
56
57 /**
58 @return Maximum number of threads that can be created
59 by this connection handler.
60 */
61 virtual uint get_max_threads() const = 0;
62};
63
64#endif // CONNECTION_HANDLER_INCLUDED
This abstract base class represents connection channel information about a new connection.
Definition: channel_info.h:47
This is a singleton class that provides various connection management related functionalities,...
Definition: connection_handler_manager.h:58
This abstract base class represents how connections are processed, most importantly how they map to O...
Definition: connection_handler.h:37
virtual uint get_max_threads() const =0
virtual bool add_connection(Channel_info *channel_info)=0
Add a connection.
virtual ~Connection_handler()=default
Connection_handler()=default
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Some integer typedefs for easier portability.