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

37 lines
810 B
C
Raw Permalink 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
2016-07-05 13:27:53 +01:00
#include <QSslSocket>
#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
// This class overrides QTcpServer to bind QSslSocket to native socket descriptor instead of QTcpSocket
class KDECONNECTCORE_EXPORT Server : public QTcpServer
2015-07-05 14:23:53 +01:00
{
Q_OBJECT
public:
2023-07-20 17:25:06 +01:00
Server(QObject *parent = nullptr);
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