QWebSocketProtocol Namespace
Enthält Konstanten zum WebSocket-Standard. Mehr...
| Header: | #include <QWebSocketProtocol> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WebSockets) target_link_libraries(mytarget PRIVATE Qt6::WebSockets) |
| qmake: | QT += websockets |
Typen
| enum | CloseCode { CloseCodeNormal, CloseCodeGoingAway, CloseCodeProtocolError, CloseCodeDatatypeNotSupported, CloseCodeReserved1004, …, CloseCodeTlsHandshakeFailed } |
| enum | Version { VersionUnknown, Version0, Version4, Version5, Version6, …, VersionLatest } |
Typdokumentation
enum QWebSocketProtocol::CloseCode
Die von WebSockets V13 unterstützten Close-Codes
| Konstante | Wert | Beschreibung |
|---|---|---|
QWebSocketProtocol::CloseCodeNormal | 1000 | Normales Schließen |
QWebSocketProtocol::CloseCodeGoingAway | 1001 | Verbindung wird getrennt |
QWebSocketProtocol::CloseCodeProtocolError | 1002 | Protokollfehler |
QWebSocketProtocol::CloseCodeDatatypeNotSupported | 1003 | Nicht unterstützte Daten |
QWebSocketProtocol::CloseCodeReserved1004 | 1004 | Reserviert |
QWebSocketProtocol::CloseCodeMissingStatusCode | 1005 | Kein Status empfangen |
QWebSocketProtocol::CloseCodeAbnormalDisconnection | 1006 | Abnormales Schließen |
QWebSocketProtocol::CloseCodeWrongDatatype | 1007 | Ungültige Frame-Nutzdaten |
QWebSocketProtocol::CloseCodePolicyViolated | 1008 | Richtlinienverstoß |
QWebSocketProtocol::CloseCodeTooMuchData | 1009 | Nachricht zu groß |
QWebSocketProtocol::CloseCodeMissingExtension | 1010 | Obligatorische Erweiterung fehlt |
QWebSocketProtocol::CloseCodeBadOperation | 1011 | Interner Serverfehler |
QWebSocketProtocol::CloseCodeTlsHandshakeFailed | 1015 | TLS-Handshake fehlgeschlagen |
Siehe auch QWebSocket::close().
enum QWebSocketProtocol::Version
Die verschiedenen definierten Versionen des WebSocket-Protokolls.
Einen Überblick über die Unterschiede zwischen den verschiedenen Protokollen finden Sie in pywebsockets WebSocketProtocolSpec.
| Konstante | Wert | Beschreibung |
|---|---|---|
QWebSocketProtocol::VersionUnknown | -1 | Unbekannte oder nicht spezifizierte Version. |
QWebSocketProtocol::Version0 | 0 | hixie76 und hybi-00. Funktioniert mit key1, key2 und einem Schlüssel in der Nutzlast. Attribut: Sec-WebSocket-Draft-Wert 0. Wird von QtWebSockets nicht unterstützt. |
QWebSocketProtocol::Version4 | 4 | hybi-04. Geänderter Handshake: key1, key2, key3 ==> Sec-WebSocket-Key, Sec-WebSocket-Nonce, Sec-WebSocket-Accept Sec-WebSocket-Draft in Sec-WebSocket-Version umbenannt Sec-WebSocket-Version = 4. Wird von QtWebSockets nicht unterstützt. |
QWebSocketProtocol::Version5 | 5 | hybi-05. Sec-WebSocket-Version = 5. Sec-WebSocket-Nonce entfernt. Sec-WebSocket-Accept hinzugefügt. Wird von QtWebSockets nicht unterstützt. |
QWebSocketProtocol::Version6 | 6 | Sec-WebSocket-Version = 6. Wird von QtWebSockets nicht unterstützt. |
QWebSocketProtocol::Version7 | 7 | hybi-07. Sec-WebSocket-Version = 7. Wird von QtWebSockets nicht unterstützt. |
QWebSocketProtocol::Version8 | 8 | hybi-8, hybi-9, hybi-10, hybi-11 und hybi-12. Die Statuscodes 1005 und 1006 wurden hinzugefügt, und alle Codes sind nun vorzeichenlos. Ein interner Fehler führt zum Code 1006. Wird von QtWebSockets nicht unterstützt. |
QWebSocketProtocol::Version13 | 13 | hybi-13, hybi-14, hybi-15, hybi-16, hybi-17 und RFC 6455. Sec-WebSocket-Version = 13 Der Statuscode 1004 ist nun reserviert. 1008, 1009 und 1010 wurden hinzugefügt. TLS muss unterstützt werden. Klärung der Unterstützung mehrerer Versionen. Wird von QtWebSockets unterstützt. |
QWebSocketProtocol::VersionLatest | Version13 | Bezieht sich auf die aktuellste bekannte Version unter QtWebSockets. |
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.