MythTV
master
|
An implementation of the WebSocket protocol... More...
#include <libmythbase/http/mythwebsocket.h>
Public Slots | |
void | Read () |
void | Write (int64_t Written=0) |
void | Close () |
Initiate the close handshake when we are exiting. More... | |
void | SendTextFrame (const QString &Text) |
void | SendBinaryFrame (const QByteArray &Data) |
Signals | |
void | NewTextMessage (const StringPayload &Text) |
void | NewRawTextMessage (const DataPayloads &Payloads) |
void | NewBinaryMessage (const DataPayloads &Payloads) |
Public Member Functions | |
~MythWebSocket () override | |
Static Public Member Functions | |
static MythWebSocket * | CreateWebsocket (bool Server, QTcpSocket *Socket, MythSocketProtocol Protocol, bool Testing) |
Protected Member Functions | |
MythWebSocket (bool Server, QTcpSocket *Socket, MythSocketProtocol Protocol, bool Testing) | |
Private Types | |
enum | ReadState : std::uint8_t { ReadHeader = 0, Read16BitLength, Read64BitLength, ReadMask, ReadPayload } |
Private Member Functions | |
void | PingReceived (DataPayload Payload) |
void | PongReceived (const DataPayload &Payload) |
void | CloseReceived (const DataPayload &Payload) |
void | CheckClose () |
void | SendClose (WSErrorCode Code, const QString &Message={}) |
void | SendPing () |
void | SendFrame (WSOpCode Code, const DataPayloads &Payloads) |
Private Attributes | |
QTcpSocket * | m_socket { nullptr } |
MythSocketProtocol | m_protocol { ProtFrame } |
WSOpCode | m_formatForProtocol { WSOpTextFrame } |
bool | m_preferRawText { false } |
bool | m_testing { false } |
QTimer * | m_timer { nullptr } |
ReadState | m_readState { ReadHeader } |
bool | m_serverSide { false } |
bool | m_closeSent { false } |
bool | m_closeReceived { false } |
bool | m_closing { false } |
WSFrame | m_currentFrame { nullptr } |
WSOpCode | m_messageOpCode { WSOpTextFrame } |
int64_t | m_messageSize { 0 } |
DataPayloads | m_dataFragments |
StringPayload | m_string { nullptr } |
QStringDecoder * | m_toUtf16 { new QStringDecoder } |
QByteArray | m_lastPingPayload |
WSQueue | m_writeQueue |
int64_t | m_writeTotal { 0 } |
QElapsedTimer | m_writeTime |
An implementation of the WebSocket protocol...
This currently passes all 303 Autobahn test suite conformance and performance tests (1.* -> 10.*) with only 3 'non-strict' passes (6.4.2, 6.4.3 and 6.4.4).
Definition at line 20 of file mythwebsocket.h.
|
private |
Enumerator | |
---|---|
ReadHeader | |
Read16BitLength | |
Read64BitLength | |
ReadMask | |
ReadPayload |
Definition at line 53 of file mythwebsocket.h.
|
override |
Definition at line 64 of file mythwebsocket.cpp.
|
protected |
Definition at line 40 of file mythwebsocket.cpp.
|
static |
Definition at line 32 of file mythwebsocket.cpp.
Referenced by MythHTTPSocket::SetupWebSocket().
|
slot |
Definition at line 96 of file mythwebsocket.cpp.
Referenced by MythWebSocket().
|
slot |
Definition at line 433 of file mythwebsocket.cpp.
Referenced by MythWebSocket(), and SendFrame().
|
slot |
Initiate the close handshake when we are exiting.
Definition at line 81 of file mythwebsocket.cpp.
Referenced by MythHTTPSocket::Stop().
|
slot |
Definition at line 86 of file mythwebsocket.cpp.
Referenced by MythHTTPSocket::SetupWebSocket().
|
slot |
Definition at line 91 of file mythwebsocket.cpp.
|
signal |
Referenced by Read(), and MythHTTPSocket::SetupWebSocket().
|
signal |
Referenced by Read(), and MythHTTPSocket::SetupWebSocket().
|
signal |
Referenced by Read(), and MythHTTPSocket::SetupWebSocket().
|
private |
Definition at line 662 of file mythwebsocket.cpp.
Referenced by Read().
|
private |
Definition at line 669 of file mythwebsocket.cpp.
Referenced by Read().
|
private |
Definition at line 529 of file mythwebsocket.cpp.
Referenced by Read().
|
private |
Definition at line 505 of file mythwebsocket.cpp.
Referenced by CloseReceived(), and SendClose().
|
private |
Definition at line 578 of file mythwebsocket.cpp.
Referenced by Close(), CloseReceived(), and Read().
|
private |
Definition at line 682 of file mythwebsocket.cpp.
Referenced by MythWebSocket().
|
private |
Definition at line 591 of file mythwebsocket.cpp.
Referenced by PingReceived(), Read(), SendBinaryFrame(), SendClose(), SendPing(), and SendTextFrame().
|
private |
Definition at line 62 of file mythwebsocket.h.
Referenced by CheckClose(), MythWebSocket(), Read(), and Write().
|
private |
Definition at line 63 of file mythwebsocket.h.
Referenced by MythWebSocket(), and Read().
|
private |
Definition at line 64 of file mythwebsocket.h.
Referenced by Read().
Definition at line 65 of file mythwebsocket.h.
Referenced by MythWebSocket(), and Read().
Definition at line 66 of file mythwebsocket.h.
Referenced by MythWebSocket(), and Read().
|
private |
Definition at line 67 of file mythwebsocket.h.
Referenced by CheckClose(), MythWebSocket(), and ~MythWebSocket().
|
private |
Definition at line 68 of file mythwebsocket.h.
Referenced by Read().
Definition at line 69 of file mythwebsocket.h.
Referenced by CheckClose(), Read(), and SendFrame().
Definition at line 70 of file mythwebsocket.h.
Referenced by CheckClose(), PingReceived(), SendClose(), and SendFrame().
Definition at line 71 of file mythwebsocket.h.
Referenced by CheckClose(), CloseReceived(), PingReceived(), Read(), and SendFrame().
Definition at line 72 of file mythwebsocket.h.
Referenced by CheckClose().
|
private |
Definition at line 74 of file mythwebsocket.h.
Referenced by Read().
|
private |
Definition at line 75 of file mythwebsocket.h.
Referenced by Read().
|
private |
Definition at line 76 of file mythwebsocket.h.
Referenced by Read().
|
private |
Definition at line 77 of file mythwebsocket.h.
Referenced by Read().
|
private |
Definition at line 78 of file mythwebsocket.h.
Referenced by Read().
|
private |
Definition at line 83 of file mythwebsocket.h.
Referenced by CloseReceived(), Read(), and ~MythWebSocket().
|
private |
Definition at line 86 of file mythwebsocket.h.
Referenced by PongReceived(), and SendPing().
|
private |
Definition at line 87 of file mythwebsocket.h.
Referenced by SendFrame(), and Write().
|
private |
Definition at line 88 of file mythwebsocket.h.
Referenced by Write().
|
private |
Definition at line 89 of file mythwebsocket.h.
Referenced by Write().