2015-07-05 14:23:53 +01:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2015 Vineet Garg <grg.vineet@gmail.com>
|
2015-07-05 14:23:53 +01:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2015-07-05 14:23:53 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KDECONNECT_SERVER_H
|
|
|
|
#define KDECONNECT_SERVER_H
|
|
|
|
|
2016-07-05 13:27:53 +01:00
|
|
|
#include <QSslSocket>
|
2022-09-10 22:23:52 +01:00
|
|
|
#include <QTcpServer>
|
2016-06-10 14:07:33 +01:00
|
|
|
|
2016-07-05 13:27:53 +01:00
|
|
|
#include "kdeconnectcore_export.h"
|
2015-07-05 14:23:53 +01:00
|
|
|
|
2015-07-25 12:45:19 +01:00
|
|
|
// This class overrides QTcpServer to bind QSslSocket to native socket descriptor instead of QTcpSocket
|
2022-09-10 22:23:52 +01:00
|
|
|
class KDECONNECTCORE_EXPORT Server : public QTcpServer
|
2015-07-05 14:23:53 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-09-10 22:23:52 +01:00
|
|
|
Server(QObject *parent = 0);
|
2016-06-20 08:05:02 +01:00
|
|
|
~Server() override = default;
|
2015-07-05 14:23:53 +01:00
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
QSslSocket *nextPendingConnection() override;
|
2020-04-06 01:38:19 +01:00
|
|
|
void close();
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void closed();
|
2015-07-09 23:27:27 +01:00
|
|
|
|
2015-07-05 14:23:53 +01:00
|
|
|
protected:
|
2016-06-20 08:05:02 +01:00
|
|
|
void incomingConnection(qintptr socketDescriptor) override;
|
2016-07-04 18:34:28 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
void errorFound(QAbstractSocket::SocketError socketError);
|
2015-07-05 14:23:53 +01:00
|
|
|
};
|
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
#endif // KDECONNECT_SERVER_H
|