This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2023-08-04 09:59:30 +02:00

48 lines
1.0 KiB
C++

#ifndef TUNNELPROXYCLIENT_H
#define TUNNELPROXYCLIENT_H
#include <QObject>
#include <QTimer>
#include "server/transportclient.h"
namespace remoteproxy {
class TunnelProxyClient : public TransportClient
{
Q_OBJECT
public:
enum Type {
TypeNone,
TypeServer,
TypeClient
};
Q_ENUM(Type)
explicit TunnelProxyClient(TransportInterface *interface, const QUuid &clientId, const QHostAddress &address, QObject *parent = nullptr);
Type type() const;
void setType(Type type);
// Json server methods
QList<QByteArray> processData(const QByteArray &data) override;
// This method will be called from the proxy server once the client is
// registered correctly as server or client connection and is now active
void activateClient();
signals:
void typeChanged(Type type);
private:
QTimer *m_inactiveTimer = nullptr;
Type m_type = TypeNone;
};
QDebug operator<< (QDebug debug, TunnelProxyClient *tunnelProxyClient);
}
#endif // TUNNELPROXYCLIENT_H