C

Message Proxy: Testing Qt Safe Renderer Messaging Interface

// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial

// This file is part of the Qt Safe Renderer module
#include <QObject>
#include <QTcpServer>
#include <QNetworkInterface>
#include <QtSafeEventSender/qsafeeventsender.h>

class QNetworkSession;
class QSafeMessageInterface;

class Server : public QObject
{
    Q_OBJECT

public:
    explicit Server(const quint16 port, QObject *parent = nullptr);

private slots:
    void newConnection();
    void readData();

private:
    void runServer(const quint16 port);
    void handleVerificationRequest(const SafeRenderer::QSafeEvent &request, QTcpSocket &clientConnection);
    QTcpServer *m_tcpServer = nullptr;
    SafeRenderer::QSafeEventSender m_messageSender;
};