kdeconnect-kde/core/backends/lan/server.h

39 lines
841 B
C
Raw Normal View History

2015-07-05 14:23:53 +01:00
/**
* SPDX-FileCopyrightText: 2015 Vineet Garg <grg.vineet@gmail.com>
2015-07-05 14:23:53 +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
#include <QTcpServer>
2016-07-05 13:27:53 +01:00
#include <QSslSocket>
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
// This class overrides QTcpServer to bind QSslSocket to native socket descriptor instead of QTcpSocket
2016-06-10 14:07:33 +01:00
class KDECONNECTCORE_EXPORT Server
2015-07-14 13:04:04 +01:00
: public QTcpServer
2015-07-05 14:23:53 +01:00
{
Q_OBJECT
public:
Server(QObject* parent = 0);
~Server() override = default;
2015-07-05 14:23:53 +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:
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
};
#endif //KDECONNECT_SERVER_H