cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
localserver.h
1/*
2 * SPDX-FileCopyrightText: (C) 2017-2023 Daniel Nicoletti <dantti12@gmail.com>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#pragma once
6
7#include <QLocalServer>
8
10namespace Cutelyst {
11
12class Server;
13class Protocol;
14class LocalSocket;
15class ServerEngine;
16class LocalServer final : public QLocalServer
17{
19public:
20 explicit LocalServer(Server *wsgi, QObject *parent = nullptr);
21
22 void setProtocol(Protocol *protocol);
23
24 LocalServer *createServer(ServerEngine *engine) const;
25
26 void pauseAccepting();
27 void resumeAccepting();
28
29 void incomingConnection(quintptr handle) override;
30
31 qintptr socket() const;
32
33 void shutdown();
34 void timeoutConnections();
35
36 Protocol *protocol() const;
37
38private:
39 QSocketNotifier *socketDescriptorNotifier() const;
40#ifdef Q_OS_UNIX
41 void socketNotifierActivated();
42#endif
43
44 QSocketNotifier *m_socketNotifier = nullptr;
45 ServerEngine *m_engine = nullptr;
46 Server *m_wsgi;
47
48 Protocol *m_protocol = nullptr;
49 qintptr m_socket = -1;
50 int m_processing = 0;
51};
52
53} // namespace Cutelyst
Implements a web server.
Definition server.h:60
The Cutelyst namespace holds all public Cutelyst API.
Q_OBJECTQ_OBJECT
QObject * parent() const const