6.0.0-rc4Source

QWebSocketProtocol Namespace

The QWebSocketProtocol namespace holds the versions and close codes of the WebSocket protocol. More…

Header#include <QWebSocketProtocol>
CMaketarget_link_libraries(app PRIVATE Nt::WebSockets)
ModuleNt WebSockets C++ Classes
Since5.3

Public Types

enumVersion
enumCloseCode

Detailed Description

Member Type Documentation

enum QWebSocketProtocol::CloseCode

The codes of the closing handshake (RFC 6455, section 7.4.1). Codes from 3000 to 4999 are for applications and libraries: they have no enumerator, but close() sends them and QWebSocket::closeCode() returns them, cast to CloseCode.

ConstantDescription
QWebSocketProtocol::CloseCodeNormalThe purpose of the connection was fulfilled.
QWebSocketProtocol::CloseCodeGoingAwayThe endpoint is going away, for example a server shutting down.
QWebSocketProtocol::CloseCodeProtocolErrorThe peer broke the protocol.
QWebSocketProtocol::CloseCodeDatatypeNotSupportedThe endpoint cannot accept the kind of data received.
QWebSocketProtocol::CloseCodeReserved1004Reserved.
QWebSocketProtocol::CloseCodeMissingStatusCodeThe close frame had no code. Never sent.
QWebSocketProtocol::CloseCodeAbnormalDisconnectionThe connection closed without a closing handshake. Never sent.
QWebSocketProtocol::CloseCodeWrongDatatypeA text message was not valid UTF-8.
QWebSocketProtocol::CloseCodePolicyViolatedThe message broke a policy of the endpoint.
QWebSocketProtocol::CloseCodeTooMuchDataA message or frame was too large.
QWebSocketProtocol::CloseCodeMissingExtensionThe server did not negotiate an extension the client needs.
QWebSocketProtocol::CloseCodeBadOperationThe endpoint met an unexpected condition.
QWebSocketProtocol::CloseCodeTlsHandshakeFailedThe TLS handshake failed. Never sent.

enum QWebSocketProtocol::Version

The versions of the WebSocket protocol. Nt speaks version 13 only.

ConstantDescription
QWebSocketProtocol::VersionUnknownAn unknown version.
QWebSocketProtocol::Version0Draft hixie-76 (hybi-00).
QWebSocketProtocol::Version4Draft hybi-04.
QWebSocketProtocol::Version5Draft hybi-05.
QWebSocketProtocol::Version6Draft hybi-06.
QWebSocketProtocol::Version7Draft hybi-07.
QWebSocketProtocol::Version8Drafts hybi-08 to hybi-12.
QWebSocketProtocol::Version13RFC 6455.
QWebSocketProtocol::VersionLatestThe latest version, Version13.