QWebSocketProtocol Namespace
Contiene costanti relative allo standard WebSocket. Per saperne di più...
| Intestazione: | #include <QWebSocketProtocol> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WebSockets) target_link_libraries(mytarget PRIVATE Qt6::WebSockets) |
| qmake: | QT += websockets |
Tipi
| enum | CloseCode { CloseCodeNormal, CloseCodeGoingAway, CloseCodeProtocolError, CloseCodeDatatypeNotSupported, CloseCodeReserved1004, …, CloseCodeTlsHandshakeFailed } |
| enum | Version { VersionUnknown, Version0, Version4, Version5, Version6, …, VersionLatest } |
Documentazione sui tipi
enum QWebSocketProtocol::CloseCode
I codici di chiusura supportati da WebSockets V13
| Costante | Valore | Descrizione |
|---|---|---|
QWebSocketProtocol::CloseCodeNormal | 1000 | Chiusura normale |
QWebSocketProtocol::CloseCodeGoingAway | 1001 | In via di disuso |
QWebSocketProtocol::CloseCodeProtocolError | 1002 | Errore di protocollo |
QWebSocketProtocol::CloseCodeDatatypeNotSupported | 1003 | Dati non supportati |
QWebSocketProtocol::CloseCodeReserved1004 | 1004 | Riservato |
QWebSocketProtocol::CloseCodeMissingStatusCode | 1005 | Nessuno stato ricevuto |
QWebSocketProtocol::CloseCodeAbnormalDisconnection | 1006 | Chiusura anomala |
QWebSocketProtocol::CloseCodeWrongDatatype | 1007 | Dati di payload del frame non validi |
QWebSocketProtocol::CloseCodePolicyViolated | 1008 | Violazione delle politiche |
QWebSocketProtocol::CloseCodeTooMuchData | 1009 | Messaggio troppo grande |
QWebSocketProtocol::CloseCodeMissingExtension | 1010 | Manca un'estensione obbligatoria |
QWebSocketProtocol::CloseCodeBadOperation | 1011 | Errore interno del server |
QWebSocketProtocol::CloseCodeTlsHandshakeFailed | 1015 | Handshake TLS non riuscito |
Vedi anche QWebSocket::close().
enum QWebSocketProtocol::Version
Le diverse versioni definite del protocollo WebSocket.
Per una panoramica delle differenze tra i vari protocolli, consultare WebSocketProtocolSpec di pywebsocket.
| Costante | Valore | Descrizione |
|---|---|---|
QWebSocketProtocol::VersionUnknown | -1 | Versione sconosciuta o non specificata. |
QWebSocketProtocol::Version0 | 0 | hixie76 e hybi-00. Funziona con key1, key2 e una chiave nel payload. Attributo: valore Sec-WebSocket-Draft 0. Non supportato da QtWebSockets. |
QWebSocketProtocol::Version4 | 4 | hybi-04. Handshake modificato: key1, key2, key3 ==> Sec-WebSocket-Key, Sec-WebSocket-Nonce, Sec-WebSocket-Accept. Sec-WebSocket-Draft rinominato in Sec-WebSocket-Version. Sec-WebSocket-Version = 4. Non supportato da QtWebSockets. |
QWebSocketProtocol::Version5 | 5 | hybi-05. Sec-WebSocket-Version = 5. Rimosso Sec-WebSocket-Nonce. Aggiunto Sec-WebSocket-Accept. Non supportato da QtWebSockets. |
QWebSocketProtocol::Version6 | 6 | Sec-WebSocket-Version = 6. Non supportato da QtWebSockets. |
QWebSocketProtocol::Version7 | 7 | hybi-07. Sec-WebSocket-Version = 7. Non supportato da QtWebSockets. |
QWebSocketProtocol::Version8 | 8 | hybi-8, hybi-9, hybi-10, hybi-11 e hybi-12. Sono stati aggiunti i codici di stato 1005 e 1006 e tutti i codici sono ora senza segno; l’errore interno genera il codice 1006. Non supportato da QtWebSockets. |
QWebSocketProtocol::Version13 | 13 | hybi-13, hybi-14, hybi-15, hybi-16, hybi-17 e RFC 6455. Sec-WebSocket-Version = 13 Il codice di stato 1004 è ora riservato. Aggiunti 1008, 1009 e 1010. Deve supportare TLS. Chiarire il supporto di più versioni. Supportato da QtWebSockets. |
QWebSocketProtocol::VersionLatest | Version13 | Si fa riferimento all’ultima versione nota su 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.