MySQL 8.3.0
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, 2023, 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 also distributed 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 included with MySQL.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License, version 2.0, for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
25
26#include "my_inttypes.h"
27
28class THD;
29class Channel_info;
31
32/**
33 This abstract base class represents how connections are processed,
34 most importantly how they map to OS threads.
35*/
37 protected:
39
40 Connection_handler() = default;
41 virtual ~Connection_handler() = default;
42
43 /**
44 Add a connection.
45
46 @param channel_info Pointer to the Channel_info object.
47
48 @note If this function is successful (returns false), the ownership of
49 channel_info is transferred. Otherwise the caller is responsible for
50 its destruction.
51
52 @return true if processing of the new connection failed, false otherwise.
53 */
54 virtual bool add_connection(Channel_info *channel_info) = 0;
55
56 /**
57 @return Maximum number of threads that can be created
58 by this connection handler.
59 */
60 virtual uint get_max_threads() const = 0;
61};
62
63#endif // CONNECTION_HANDLER_INCLUDED
This abstract base class represents connection channel information about a new connection.
Definition: channel_info.h:46
This is a singleton class that provides various connection management related functionalities,...
Definition: connection_handler_manager.h:57
This abstract base class represents how connections are processed, most importantly how they map to O...
Definition: connection_handler.h:36
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:35
Some integer typedefs for easier portability.