包含 WebSocket 標準相關常量。 更多...
| 頭: | #include <QWebSocketProtocol> |
| qmake: | QT += websockets |
| Since: | Qt 5.3 |
該名稱空間在 Qt 5.3 引入。
| enum | CloseCode { CloseCodeNormal, CloseCodeGoingAway, CloseCodeProtocolError, CloseCodeDatatypeNotSupported, CloseCodeReserved1004, …, CloseCodeTlsHandshakeFailed } |
| enum | Version { VersionUnknown, Version0, Version4, Version5, Version6, …, VersionLatest } |
由 WebSockets V13 支持的關閉代碼
| 常量 | 值 | 描述 |
|---|---|---|
QWebSocketProtocol::CloseCodeNormal
|
1000
|
正常關閉 |
QWebSocketProtocol::CloseCodeGoingAway
|
1001
|
離開 |
QWebSocketProtocol::CloseCodeProtocolError
|
1002
|
協議錯誤 |
QWebSocketProtocol::CloseCodeDatatypeNotSupported
|
1003
|
不支持的數據 |
QWebSocketProtocol::CloseCodeReserved1004
|
1004
|
預留 |
QWebSocketProtocol::CloseCodeMissingStatusCode
|
1005
|
未收到狀態 |
QWebSocketProtocol::CloseCodeAbnormalDisconnection
|
1006
|
異常關閉 |
QWebSocketProtocol::CloseCodeWrongDatatype
|
1007
|
無效幀負載數據 |
QWebSocketProtocol::CloseCodePolicyViolated
|
1008
|
違反策略 |
QWebSocketProtocol::CloseCodeTooMuchData
|
1009
|
消息太大 |
QWebSocketProtocol::CloseCodeMissingExtension
|
1010
|
缺少強製性擴展 |
QWebSocketProtocol::CloseCodeBadOperation
|
1011
|
內部服務器錯誤 |
QWebSocketProtocol::CloseCodeTlsHandshakeFailed
|
1015
|
TLS 握手失敗 |
另請參閱 QWebSocket::close ().
WebSocket 協議的不同定義版本。
有關不同協議之間差異的概述,見 pywebsocket's WebSocketProtocolSpec .
| 常量 | 值 | 描述 |
|---|---|---|
QWebSocketProtocol::VersionUnknown
|
-1
|
未知或未指定的版本。 |
QWebSocketProtocol::Version0
|
0
|
hixie76 and hybi-00 . Works with key1, key2 and a key in the payload. Attribute: Sec-WebSocket-Draft value 0. Not supported by QtWebSockets . |
QWebSocketProtocol::Version4
|
4
|
hybi-04 . Changed handshake: key1, key2, key3 ==> Sec-WebSocket-Key, Sec-WebSocket-Nonce, Sec-WebSocket-Accept Sec-WebSocket-Draft renamed to Sec-WebSocket-Version Sec-WebSocket-Version = 4. Not supported by QtWebSockets . |
QWebSocketProtocol::Version5
|
5
|
hybi-05 . Sec-WebSocket-Version = 5 Removed Sec-WebSocket-Nonce Added Sec-WebSocket-Accept. Not supported by QtWebSockets . |
QWebSocketProtocol::Version6
|
6
|
Sec-WebSocket-Version = 6. Not supported by QtWebSockets . |
QWebSocketProtocol::Version7
|
7
|
hybi-07 . Sec-WebSocket-Version = 7. Not supported by QtWebSockets . |
QWebSocketProtocol::Version8
|
8
|
hybi-8, hybi-9, hybi-10, hybi-11 and hybi-12. Status codes 1005 and 1006 are added and all codes are now unsigned Internal error results in 1006. Not supported by QtWebSockets . |
QWebSocketProtocol::Version13
|
13
|
hybi-13, hybi14, hybi-15, hybi-16, hybi-17 and RFC 6455 . Sec-WebSocket-Version = 13 Status code 1004 is now reserved Added 1008, 1009 and 1010 Must support TLS Clarify multiple version support. Supported by QtWebSockets . |
QWebSocketProtocol::VersionLatest
|
Version13
|
引用最新已知版本的 QtWebSockets . |