cutelyst
4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
tcpserverbalancer.h
1
/*
2
* SPDX-FileCopyrightText: (C) 2017 Daniel Nicoletti <dantti12@gmail.com>
3
* SPDX-License-Identifier: BSD-3-Clause
4
*/
5
#ifndef TCPSERVERBALANCER_H
6
#define TCPSERVERBALANCER_H
7
8
#include <QTcpServer>
9
#include <QtGlobal>
10
11
class
QSslConfiguration
;
12
13
namespace
Cutelyst
{
14
15
class
Server;
16
class
TcpServer;
17
class
ServerEngine;
18
class
Protocol;
19
class
TcpServerBalancer
final :
public
QTcpServer
20
{
21
Q_OBJECT
22
public
:
23
TcpServerBalancer
(
Server
*
parent
);
24
~TcpServerBalancer
()
override
;
25
26
bool
listen(
const
QString
&address,
Protocol
*protocol,
bool
secure);
27
28
void
setBalancer(
bool
enable);
29
QByteArray
serverName()
const
{
return
m_serverName; }
30
31
void
incomingConnection(qintptr handle)
override
;
32
33
TcpServer
*createServer(
ServerEngine
*engine);
34
35
private
:
36
QHostAddress
m_address;
37
quint16 m_port = 0;
38
QByteArray
m_serverName;
39
std::vector<TcpServer *> m_servers;
40
Server
*m_wsgi;
41
Protocol
*m_protocol =
nullptr
;
42
QSslConfiguration
*m_sslConfiguration =
nullptr
;
43
int
m_currentServer = 0;
44
bool
m_balancer =
false
;
45
};
46
47
}
// namespace Cutelyst
48
49
#endif
// TCPSERVERBALANCER_H
Cutelyst::Protocol
Definition
protocol.h:70
Cutelyst::ServerEngine
Definition
serverengine.h:25
Cutelyst::Server
Implements a web server.
Definition
server.h:60
Cutelyst::TcpServerBalancer
Definition
tcpserverbalancer.h:20
Cutelyst::TcpServer
Definition
tcpserver.h:17
Cutelyst
The Cutelyst namespace holds all public Cutelyst API.
Definition
group-core-actions.dox:1
QByteArray
QHostAddress
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QSslConfiguration
QString
QTcpServer
Cutelyst
Server
tcpserverbalancer.h
Generated by
1.9.8