AusweisApp
 
Lade ...
Suche ...
Keine Treffer
WebSocketChannel.h
gehe zur Dokumentation dieser Datei
1
4
5#pragma once
6
7#include "DataChannel.h"
8
9#include <QByteArray>
10#include <QObject>
11#include <QTimer>
12#include <QWebSocket>
13
14
15namespace governikus
16{
18 : public DataChannel
19{
20 Q_OBJECT
21
22 private:
23 const QSharedPointer<QWebSocket> mConnection;
24 const QByteArray mId;
25 QTimer mPingTimer;
26 QTimer mPongTimer;
27 static QByteArray makeConnectionId(const QSharedPointer<QWebSocket>& pConnection);
28
29 public:
30 explicit WebSocketChannel(const QSharedPointer<QWebSocket>& pConnection);
31 ~WebSocketChannel() override;
32
33 void send(const QByteArray& pDataBlock) override;
34 void close() override;
35 [[nodiscard]] bool isPairingConnection() const override;
36 [[nodiscard]] const QByteArray& getId() const override;
37
38 private Q_SLOTS:
39 void onReceived(const QString& pMessage);
40 void onDisconnected();
41 void onPingScheduled();
42 void onPongReceived();
43 void onPongTimeout();
44};
45
46} // namespace governikus
~WebSocketChannel() override
Definition WebSocketChannel.cpp:61
void send(const QByteArray &pDataBlock) override
Definition WebSocketChannel.cpp:74
void close() override
Definition WebSocketChannel.cpp:83
WebSocketChannel(const QSharedPointer< QWebSocket > &pConnection)
Definition WebSocketChannel.cpp:38
const QByteArray & getId() const override
Definition WebSocketChannel.cpp:107
bool isPairingConnection() const override
Definition WebSocketChannel.cpp:100
Defines the AccessRight and AccessRole enum.
Definition CommandApdu.h:17