Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
IceSignalWebSocket.h
1
2
3#ifndef CICESIGNAL_H
4#define CICESIGNAL_H
5
6#include "IceSignal.h"
7#include "rtc/rtc.hpp"
8#include <QMutex>
9
11{
12 Q_OBJECT
13
14public:
15 explicit CIceSignalWebSocket(QObject *parent = nullptr);
16 virtual ~CIceSignalWebSocket();
17
18 virtual int Open(const std::string& szServer, quint16 nPort,
19 const std::string &user = std::string(),
20 const std::string &password = std::string()) override;
21 int Open(const std::string &szUrl,
22 const std::string &user = std::string(),
23 const std::string &password = std::string());
24 virtual int Close() override;
25 virtual bool IsOpen() override;
26
27 virtual int SendDescription(const QString& toUser,
28 const QString& channelId,
29 const rtc::Description& description,
30 const QString& fromUser = QString()) override;
31 virtual int SendCandiate(const QString& toUser,
32 const QString& channelId,
33 const rtc::Candidate& candidate,
34 const QString& fromUser = QString()) override;
35
36 virtual int Write(const char* buf, int nLen) override;
37 virtual int Read(char* buf, int nLen) override;
38
39private:
40 std::shared_ptr<rtc::WebSocket> m_webSocket;
41 std::string m_szUrl;
42 std::string m_szUser, m_szPeerUser;
43 rtc::binary m_Data;
44 QMutex m_MutexSend;
45};
46
47#endif // CICESIGNAL_H
The ICE signal interface class.
Definition IceSignal.h:26