16 : HTTP::HTTPSSession(server)
50 HTTPSSession::onReceived(buffer, size);
62 HTTPSSession::onReceivedRequestHeader(request);
78 HTTPSSession::onReceivedRequest(request);
86 onError(asio::error::fault,
"WebSocket error", error);
90 HTTPSSession::onReceivedRequestError(request, error);
100 std::vector<uint8_t>
cache;
108 cache.resize(required);
109 size_t received = HTTPSSession::Receive(
cache.data(), required);
110 if (received != required)
131 std::vector<uint8_t>
cache;
139 cache.resize(required);
140 size_t received = HTTPSSession::Receive(
cache.data(), required, timeout);
141 if (received != required)
157 std::vector<uint8_t> result;
162 std::vector<uint8_t>
cache;
170 cache.resize(required);
171 size_t received = HTTPSSession::Receive(
cache.data(), required);
172 if (received != required)
188 std::vector<uint8_t> result;
193 std::vector<uint8_t>
cache;
201 cache.resize(required);
202 size_t received = HTTPSSession::Receive(
cache.data(), required, timeout);
203 if (received != required)
virtual void onError(int error, const std::string &category, const std::string &message)
Handle error notification.
HTTPRequest & Clear()
Clear the HTTP request cache.
std::string_view body() const noexcept
Get the HTTP request body.
HTTPResponse & Clear()
Clear the HTTP response cache.
HTTPRequest _request
HTTP request.
HTTPResponse & response() noexcept
Get the HTTP response.
HTTPResponse _response
HTTP response.
CppCommon::FileCache & cache() noexcept
Get the static content cache.
void onDisconnected() override
Handle session disconnected notification.
std::string ReceiveText()
void onReceivedRequest(const HTTP::HTTPRequest &request) override
Handle HTTP request received notification.
void onReceived(const void *buffer, size_t size) override
Handle buffer received notification.
std::vector< uint8_t > ReceiveBinary()
void onReceivedRequestHeader(const HTTP::HTTPRequest &request) override
Handle HTTP request header received notification.
void onReceivedRequestError(const HTTP::HTTPRequest &request, const std::string &error) override
Handle HTTP request error notification.
WSSSession(const std::shared_ptr< WSSServer > &server)
size_t _ws_payload_size
Received frame payload size.
bool _ws_frame_received
Received frame flag.
void InitWSNonce()
Initialize WebSocket random nonce.
void PrepareReceiveFrame(const void *buffer, size_t size)
Prepare WebSocket receive frame.
std::vector< uint8_t > _ws_receive_final_buffer
Receive final buffer.
void ClearWSBuffers()
Clear WebSocket send/receive buffers.
size_t RequiredReceiveFrameSize()
Required WebSocket receive frame size.
bool _ws_final_received
Received final flag.
size_t _ws_header_size
Received frame header size.
virtual void onWSDisconnected()
Handle WebSocket client disconnected notification.
bool PerformServerUpgrade(const HTTP::HTTPRequest &request, HTTP::HTTPResponse &response)
Perform WebSocket server upgrade.
bool _ws_handshaked
Handshaked flag.
C++ Server project definitions.
WebSocket secure server definition.
WebSocket secure session definition.