QHttpServerWebSocketUpgradeResponse Class
HTTP 서버에서 웹소켓 업그레이드를 확인할 때 반환할 응답입니다. 더 보기...
헤더: | #include <QHttpServerWebSocketUpgradeResponse> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS HttpServer) target_link_libraries(mytarget PRIVATE Qt6::HttpServer) |
qmake: | QT += httpserver |
이후: | Qt 6.8 |
공용 형
enum class | ResponseType { Accept, Deny, PassToNext } |
공용 함수
QHttpServerWebSocketUpgradeResponse(const QHttpServerWebSocketUpgradeResponse &other) | |
~QHttpServerWebSocketUpgradeResponse() | |
QByteArray | denyMessage() && |
const QByteArray & | denyMessage() const & |
int | denyStatus() const |
void | swap(QHttpServerWebSocketUpgradeResponse &other) |
QHttpServerWebSocketUpgradeResponse::ResponseType | type() const |
QHttpServerWebSocketUpgradeResponse & | operator=(QHttpServerWebSocketUpgradeResponse &&other) |
QHttpServerWebSocketUpgradeResponse & | operator=(const QHttpServerWebSocketUpgradeResponse &other) |
정적 공용 멤버
QHttpServerWebSocketUpgradeResponse | accept() |
QHttpServerWebSocketUpgradeResponse | deny() |
QHttpServerWebSocketUpgradeResponse | deny(int status, QByteArray message) |
QHttpServerWebSocketUpgradeResponse | passToNext() |
상세 설명
소켓 업그레이드 성공 여부를 결정할 때 이 클래스를 사용하여 반환합니다. type ()가 Accept 이면 소켓을 업그레이드하고, type()가 Deny 이면 주어진 denyStatus() 및 denyMessage()와 함께 오류를 전송하며, type()가 PassToNext 이면 등록된 다음 핸들러로 진행합니다. 모든 핸들러가 PassToNext 를 반환하거나 존재하지 않으면 QAbstractHttpServer::missingHandler()가 실행됩니다.
QAbstractHttpServer::addWebSocketUpgradeVerifier() 및 QAbstractHttpServer::missingHandler()도 참조하세요 .
멤버 유형 문서
enum class QHttpServerWebSocketUpgradeResponse::ResponseType
응답 유형
상수 | 값 | 설명 |
---|---|---|
QHttpServerWebSocketUpgradeResponse::ResponseType::Accept | 0 | 웹소켓 업그레이드 요청을 수락합니다. |
QHttpServerWebSocketUpgradeResponse::ResponseType::Deny | 1 | 웹소켓 업그레이드 요청을 거부합니다. |
QHttpServerWebSocketUpgradeResponse::ResponseType::PassToNext | 2 | 웹소켓 업그레이드 결정이 있는 경우 다음 검증자에게 전달합니다. |
QAbstractHttpServer::addWebSocketUpgradeVerifier() 및 type()도 참조하세요 .
멤버 함수 문서
QHttpServerWebSocketUpgradeResponse::QHttpServerWebSocketUpgradeResponse(const QHttpServerWebSocketUpgradeResponse &other)
복사- other 에서 QHttpServerWebSocketUpgradeResponse 객체의 인스턴스를 구성합니다.
[noexcept]
QHttpServerWebSocketUpgradeResponse::~QHttpServerWebSocketUpgradeResponse()
QHttpServerWebSocketUpgradeResponse 객체를 삭제합니다.
[static]
QHttpServerWebSocketUpgradeResponse QHttpServerWebSocketUpgradeResponse::accept()
type() Accept 를 사용하여 QHttpServerWebSocketUpgradeResponse 의 인스턴스를 만듭니다.
ResponseType 및 type()도 참조하세요 .
[static]
QHttpServerWebSocketUpgradeResponse QHttpServerWebSocketUpgradeResponse::deny()
type() Deny, denyStatus() 403 및 denyMessage() "금지됨"을 사용하여 QHttpServerWebSocketUpgradeResponse 의 인스턴스를 생성합니다.
ResponseType, type(), denyStatus() 및 denyMessage()도 참조하세요 .
[static]
QHttpServerWebSocketUpgradeResponse QHttpServerWebSocketUpgradeResponse::deny(int status, QByteArray message)
type() Deny, denyStatus() status 및 denyMessage() message 을 사용하여 QHttpServerWebSocketUpgradeResponse 의 인스턴스를 생성합니다.
ResponseType, type(), denyStatus() 및 denyMessage()도 참조하세요 .
QByteArray QHttpServerWebSocketUpgradeResponse::denyMessage() &&
type()가 Deny 인 경우 반환할 오류 메시지를 반환합니다.
const QByteArray &QHttpServerWebSocketUpgradeResponse::denyMessage() const &
type()가 Deny 인 경우 반환할 오류 메시지를 반환합니다.
int QHttpServerWebSocketUpgradeResponse::denyStatus() const
type()가 Deny 인 경우 반환할 HTTP 상태 코드를 반환합니다.
[static]
QHttpServerWebSocketUpgradeResponse QHttpServerWebSocketUpgradeResponse::passToNext()
type() PassToNext 를 사용하여 QHttpServerWebSocketUpgradeResponse 의 인스턴스를 만듭니다.
ResponseType 및 type()도 참조하세요 .
[noexcept]
void QHttpServerWebSocketUpgradeResponse::swap(QHttpServerWebSocketUpgradeResponse &other)
이 내용을 다음과 같이 바꿉니다. other
QHttpServerWebSocketUpgradeResponse::ResponseType QHttpServerWebSocketUpgradeResponse::type() const
응답 유형을 반환합니다.
ResponseType도 참조하세요 .
[noexcept]
QHttpServerWebSocketUpgradeResponse &QHttpServerWebSocketUpgradeResponse::operator=(QHttpServerWebSocketUpgradeResponse &&other)
이동 - other 값을 이 개체에 할당합니다.
QHttpServerWebSocketUpgradeResponse &QHttpServerWebSocketUpgradeResponse::operator=(const QHttpServerWebSocketUpgradeResponse &other)
복사 - other 값을 이 개체에 할당합니다.
© 2025 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.