|
| WSSession (const std::shared_ptr< WSServer > &server) |
|
| WSSession (const WSSession &)=delete |
|
| WSSession (WSSession &&)=delete |
|
virtual | ~WSSession ()=default |
|
WSSession & | operator= (const WSSession &)=delete |
|
WSSession & | operator= (WSSession &&)=delete |
|
virtual bool | Close () |
|
virtual bool | Close (int status) |
|
virtual bool | Close (int status, const void *buffer, size_t size) |
|
virtual bool | Close (int status, std::string_view text) |
|
size_t | SendText (const void *buffer, size_t size) |
|
size_t | SendText (std::string_view text) |
|
size_t | SendText (const void *buffer, size_t size, const CppCommon::Timespan &timeout) |
|
size_t | SendText (std::string_view text, const CppCommon::Timespan &timeout) |
|
bool | SendTextAsync (const void *buffer, size_t size) |
|
bool | SendTextAsync (std::string_view text) |
|
size_t | SendBinary (const void *buffer, size_t size) |
|
size_t | SendBinary (std::string_view text) |
|
size_t | SendBinary (const void *buffer, size_t size, const CppCommon::Timespan &timeout) |
|
size_t | SendBinary (std::string_view text, const CppCommon::Timespan &timeout) |
|
bool | SendBinaryAsync (const void *buffer, size_t size) |
|
bool | SendBinaryAsync (std::string_view text) |
|
size_t | SendClose (int status, const void *buffer, size_t size) |
|
size_t | SendClose (int status, std::string_view text) |
|
size_t | SendClose (int status, const void *buffer, size_t size, const CppCommon::Timespan &timeout) |
|
size_t | SendClose (int status, std::string_view text, const CppCommon::Timespan &timeout) |
|
bool | SendCloseAsync (int status, const void *buffer, size_t size) |
|
bool | SendCloseAsync (int status, std::string_view text) |
|
size_t | SendPing (const void *buffer, size_t size) |
|
size_t | SendPing (std::string_view text) |
|
size_t | SendPing (const void *buffer, size_t size, const CppCommon::Timespan &timeout) |
|
size_t | SendPing (std::string_view text, const CppCommon::Timespan &timeout) |
|
bool | SendPingAsync (const void *buffer, size_t size) |
|
bool | SendPingAsync (std::string_view text) |
|
size_t | SendPong (const void *buffer, size_t size) |
|
size_t | SendPong (std::string_view text) |
|
size_t | SendPong (const void *buffer, size_t size, const CppCommon::Timespan &timeout) |
|
size_t | SendPong (std::string_view text, const CppCommon::Timespan &timeout) |
|
bool | SendPongAsync (const void *buffer, size_t size) |
|
bool | SendPongAsync (std::string_view text) |
|
std::string | ReceiveText () |
|
std::string | ReceiveText (const CppCommon::Timespan &timeout) |
|
std::vector< uint8_t > | ReceiveBinary () |
|
std::vector< uint8_t > | ReceiveBinary (const CppCommon::Timespan &timeout) |
|
| HTTPSession (const std::shared_ptr< HTTPServer > &server) |
|
| HTTPSession (const HTTPSession &)=delete |
|
| HTTPSession (HTTPSession &&)=delete |
|
virtual | ~HTTPSession ()=default |
|
HTTPSession & | operator= (const HTTPSession &)=delete |
|
HTTPSession & | operator= (HTTPSession &&)=delete |
|
CppCommon::FileCache & | cache () noexcept |
| Get the static content cache. More...
|
|
const CppCommon::FileCache & | cache () const noexcept |
|
HTTPResponse & | response () noexcept |
| Get the HTTP response. More...
|
|
const HTTPResponse & | response () const noexcept |
|
size_t | SendResponse () |
| Send the current HTTP response (synchronous) More...
|
|
size_t | SendResponse (const HTTPResponse &response) |
| Send the HTTP response (synchronous) More...
|
|
size_t | SendResponseBody (std::string_view body) |
| Send the HTTP response body (synchronous) More...
|
|
size_t | SendResponseBody (const void *buffer, size_t size) |
| Send the HTTP response body (synchronous) More...
|
|
size_t | SendResponse (const CppCommon::Timespan &timeout) |
| Send the current HTTP response with timeout (synchronous) More...
|
|
size_t | SendResponse (const HTTPResponse &response, const CppCommon::Timespan &timeout) |
| Send the HTTP response with timeout (synchronous) More...
|
|
size_t | SendResponseBody (std::string_view body, const CppCommon::Timespan &timeout) |
| Send the HTTP response body with timeout (synchronous) More...
|
|
size_t | SendResponseBody (const void *buffer, size_t size, const CppCommon::Timespan &timeout) |
| Send the HTTP response body with timeout (synchronous) More...
|
|
bool | SendResponseAsync () |
| Send the current HTTP response (asynchronous) More...
|
|
bool | SendResponseAsync (const HTTPResponse &response) |
| Send the HTTP response (asynchronous) More...
|
|
bool | SendResponseBodyAsync (std::string_view body) |
| Send the HTTP response body (asynchronous) More...
|
|
bool | SendResponseBodyAsync (const void *buffer, size_t size) |
| Send the HTTP response body (asynchronous) More...
|
|
| TCPSession (const std::shared_ptr< TCPServer > &server) |
| Initialize the session with a given server. More...
|
|
| TCPSession (const TCPSession &)=delete |
|
| TCPSession (TCPSession &&)=delete |
|
virtual | ~TCPSession ()=default |
|
TCPSession & | operator= (const TCPSession &)=delete |
|
TCPSession & | operator= (TCPSession &&)=delete |
|
const CppCommon::UUID & | id () const noexcept |
| Get the session Id. More...
|
|
std::shared_ptr< TCPServer > & | server () noexcept |
| Get the server. More...
|
|
std::shared_ptr< asio::io_service > & | io_service () noexcept |
| Get the Asio IO service. More...
|
|
asio::io_service::strand & | strand () noexcept |
| Get the Asio service strand for serialized handler execution. More...
|
|
asio::ip::tcp::socket & | socket () noexcept |
| Get the session socket. More...
|
|
uint64_t | bytes_pending () const noexcept |
| Get the number of bytes pending sent by the session. More...
|
|
uint64_t | bytes_sent () const noexcept |
| Get the number of bytes sent by the session. More...
|
|
uint64_t | bytes_received () const noexcept |
| Get the number of bytes received by the session. More...
|
|
size_t | option_receive_buffer_limit () const noexcept |
| Get the option: receive buffer limit. More...
|
|
size_t | option_receive_buffer_size () const |
| Get the option: receive buffer size. More...
|
|
size_t | option_send_buffer_limit () const noexcept |
| Get the option: send buffer limit. More...
|
|
size_t | option_send_buffer_size () const |
| Get the option: send buffer size. More...
|
|
bool | IsConnected () const noexcept |
| Is the session connected? More...
|
|
virtual bool | Disconnect () |
| Disconnect the session. More...
|
|
virtual size_t | Send (const void *buffer, size_t size) |
| Send data to the client (synchronous) More...
|
|
virtual size_t | Send (std::string_view text) |
| Send text to the client (synchronous) More...
|
|
virtual size_t | Send (const void *buffer, size_t size, const CppCommon::Timespan &timeout) |
| Send data to the client with timeout (synchronous) More...
|
|
virtual size_t | Send (std::string_view text, const CppCommon::Timespan &timeout) |
| Send text to the client with timeout (synchronous) More...
|
|
virtual bool | SendAsync (const void *buffer, size_t size) |
| Send data to the client (asynchronous) More...
|
|
virtual bool | SendAsync (std::string_view text) |
| Send text to the client (asynchronous) More...
|
|
virtual size_t | Receive (void *buffer, size_t size) |
| Receive data from the client (synchronous) More...
|
|
virtual std::string | Receive (size_t size) |
| Receive text from the client (synchronous) More...
|
|
virtual size_t | Receive (void *buffer, size_t size, const CppCommon::Timespan &timeout) |
| Receive data from the client with timeout (synchronous) More...
|
|
virtual std::string | Receive (size_t size, const CppCommon::Timespan &timeout) |
| Receive text from the client with timeout (synchronous) More...
|
|
virtual void | ReceiveAsync () |
| Receive data from the client (asynchronous) More...
|
|
void | SetupReceiveBufferLimit (size_t limit) noexcept |
| Setup option: receive buffer limit. More...
|
|
void | SetupReceiveBufferSize (size_t size) |
| Setup option: receive buffer size. More...
|
|
void | SetupSendBufferLimit (size_t limit) noexcept |
| Setup option: send buffer limit. More...
|
|
void | SetupSendBufferSize (size_t size) |
| Setup option: send buffer size. More...
|
|
|
void | onDisconnected () override |
| Handle session disconnected notification. More...
|
|
void | onReceived (const void *buffer, size_t size) override |
| Handle buffer received notification. More...
|
|
void | onReceivedRequestHeader (const HTTP::HTTPRequest &request) override |
| Handle HTTP request header received notification. More...
|
|
void | onReceivedRequest (const HTTP::HTTPRequest &request) override |
| Handle HTTP request received notification. More...
|
|
void | onReceivedRequestError (const HTTP::HTTPRequest &request, const std::string &error) override |
| Handle HTTP request error notification. More...
|
|
void | onWSClose (const void *buffer, size_t size, int status=1000) override |
| Handle WebSocket close notification. More...
|
|
void | onWSPing (const void *buffer, size_t size) override |
| Handle WebSocket ping notification. More...
|
|
void | onWSError (const std::string &message) override |
| Handle WebSocket error notification. More...
|
|
virtual void | onReceivedCachedRequest (const HTTPRequest &request, std::string_view content) |
| Handle HTTP cached request received notification. More...
|
|
virtual void | onConnected () |
| Handle session connected notification. More...
|
|
virtual void | onSent (size_t sent, size_t pending) |
| Handle buffer sent notification. More...
|
|
virtual void | onEmpty () |
| Handle empty send buffer notification. More...
|
|
virtual void | onError (int error, const std::string &category, const std::string &message) |
| Handle error notification. More...
|
|
virtual void | onWSConnecting (HTTP::HTTPRequest &request) |
| Handle WebSocket client connecting notification. More...
|
|
virtual void | onWSConnected (const HTTP::HTTPResponse &response) |
| Handle WebSocket client connected notification. More...
|
|
virtual bool | onWSConnecting (const HTTP::HTTPRequest &request, HTTP::HTTPResponse &response) |
| Handle WebSocket server session validating notification. More...
|
|
virtual void | onWSConnected (const HTTP::HTTPRequest &request) |
| Handle WebSocket server session connected notification. More...
|
|
virtual void | onWSDisconnected () |
| Handle WebSocket client disconnected notification. More...
|
|
virtual void | onWSReceived (const void *buffer, size_t size) |
| Handle WebSocket received notification. More...
|
|
virtual void | onWSPong (const void *buffer, size_t size) |
| Handle WebSocket pong notification. More...
|
|
| WebSocket () |
|
| WebSocket (const WebSocket &)=delete |
|
| WebSocket (WebSocket &&)=delete |
|
| ~WebSocket ()=default |
|
WebSocket & | operator= (const WebSocket &)=delete |
|
WebSocket & | operator= (WebSocket &&)=delete |
|
std::string_view | ws_nonce () const noexcept |
| Get the WebSocket random nonce. More...
|
|
bool | PerformClientUpgrade (const HTTP::HTTPResponse &response, const CppCommon::UUID &id) |
| Perform WebSocket client upgrade. More...
|
|
bool | PerformServerUpgrade (const HTTP::HTTPRequest &request, HTTP::HTTPResponse &response) |
| Perform WebSocket server upgrade. More...
|
|
void | PrepareSendFrame (uint8_t opcode, bool mask, const void *buffer, size_t size, int status=0) |
| Prepare WebSocket send frame. More...
|
|
void | PrepareReceiveFrame (const void *buffer, size_t size) |
| Prepare WebSocket receive frame. More...
|
|
size_t | RequiredReceiveFrameSize () |
| Required WebSocket receive frame size. More...
|
|
void | ClearWSBuffers () |
| Clear WebSocket send/receive buffers. More...
|
|
void | InitWSNonce () |
| Initialize WebSocket random nonce. More...
|
|