CppServer  1.0.4.0
C++ Server Library
Public Member Functions | Protected Member Functions | List of all members
CppServer::WS::WSClient Class Reference

WebSocket client. More...

#include <ws_client.h>

Inheritance diagram for CppServer::WS::WSClient:
CppServer::HTTP::HTTPClient CppServer::WS::WebSocket CppServer::Asio::TCPClient

Public Member Functions

 WSClient (const WSClient &)=delete
 
 WSClient (WSClient &&)=delete
 
virtual ~WSClient ()=default
 
WSClientoperator= (const WSClient &)=delete
 
WSClientoperator= (WSClient &&)=delete
 
bool Connect () override
 Connect the client (synchronous) More...
 
bool Connect (const std::shared_ptr< Asio::TCPResolver > &resolver) override
 
bool ConnectAsync () override
 Connect the client (asynchronous) More...
 
bool ConnectAsync (const std::shared_ptr< Asio::TCPResolver > &resolver) override
 
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)
 
virtual bool CloseAsync ()
 
virtual bool CloseAsync (int status)
 
virtual bool CloseAsync (int status, const void *buffer, size_t size)
 
virtual bool CloseAsync (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)
 
- Public Member Functions inherited from CppServer::HTTP::HTTPClient
 HTTPClient (const HTTPClient &)=delete
 
 HTTPClient (HTTPClient &&)=delete
 
virtual ~HTTPClient ()=default
 
HTTPClientoperator= (const HTTPClient &)=delete
 
HTTPClientoperator= (HTTPClient &&)=delete
 
HTTPRequestrequest () noexcept
 Get the HTTP request. More...
 
const HTTPRequestrequest () const noexcept
 
size_t SendRequest ()
 Send the current HTTP request (synchronous) More...
 
size_t SendRequest (const HTTPRequest &request)
 Send the HTTP request (synchronous) More...
 
size_t SendRequestBody (std::string_view body)
 Send the HTTP request body (synchronous) More...
 
size_t SendRequestBody (const void *buffer, size_t size)
 Send the HTTP request body (synchronous) More...
 
size_t SendRequest (const CppCommon::Timespan &timeout)
 Send the current HTTP request with timeout (synchronous) More...
 
size_t SendRequest (const HTTPRequest &request, const CppCommon::Timespan &timeout)
 Send the HTTP request with timeout (synchronous) More...
 
size_t SendRequestBody (std::string_view body, const CppCommon::Timespan &timeout)
 Send the HTTP request body with timeout (synchronous) More...
 
size_t SendRequestBody (const void *buffer, size_t size, const CppCommon::Timespan &timeout)
 Send the HTTP request body with timeout (synchronous) More...
 
bool SendRequestAsync ()
 Send the current HTTP request (asynchronous) More...
 
bool SendRequestAsync (const HTTPRequest &request)
 Send the HTTP request (asynchronous) More...
 
bool SendRequestBodyAsync (std::string_view body)
 Send the HTTP request body (asynchronous) More...
 
bool SendRequestBodyAsync (const void *buffer, size_t size)
 Send the HTTP request body (asynchronous) More...
 
- Public Member Functions inherited from CppServer::Asio::TCPClient
 TCPClient (const std::shared_ptr< Service > &service, const std::string &address, int port)
 Initialize TCP client with a given Asio service, server address and port number. More...
 
 TCPClient (const std::shared_ptr< Service > &service, const std::string &address, const std::string &scheme)
 Initialize TCP client with a given Asio service, server address and scheme name. More...
 
 TCPClient (const std::shared_ptr< Service > &service, const asio::ip::tcp::endpoint &endpoint)
 Initialize TCP client with a given Asio service and endpoint. More...
 
 TCPClient (const TCPClient &)=delete
 
 TCPClient (TCPClient &&)=delete
 
virtual ~TCPClient ()=default
 
TCPClientoperator= (const TCPClient &)=delete
 
TCPClientoperator= (TCPClient &&)=delete
 
const CppCommon::UUID & id () const noexcept
 Get the client Id. More...
 
std::shared_ptr< Service > & service () noexcept
 Get the Asio service. 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::endpoint & endpoint () noexcept
 Get the client endpoint. More...
 
asio::ip::tcp::socket & socket () noexcept
 Get the client socket. More...
 
const std::string & address () const noexcept
 Get the server address. More...
 
const std::string & scheme () const noexcept
 Get the scheme name. More...
 
int port () const noexcept
 Get the server port number. More...
 
uint64_t bytes_pending () const noexcept
 Get the number of bytes pending sent by the client. More...
 
uint64_t bytes_sent () const noexcept
 Get the number of bytes sent by the client. More...
 
uint64_t bytes_received () const noexcept
 Get the number of bytes received by the client. More...
 
bool option_keep_alive () const noexcept
 Get the option: keep alive. More...
 
bool option_no_delay () const noexcept
 Get the option: no delay. 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 client connected? More...
 
virtual bool Connect (const std::shared_ptr< TCPResolver > &resolver)
 Connect the client using the given DNS resolver (synchronous) More...
 
virtual bool Disconnect ()
 Disconnect the client (synchronous) More...
 
virtual bool Reconnect ()
 Reconnect the client (synchronous) More...
 
virtual bool ConnectAsync (const std::shared_ptr< TCPResolver > &resolver)
 Connect the client using the given DNS resolver (asynchronous) More...
 
virtual bool DisconnectAsync ()
 Disconnect the client (asynchronous) More...
 
virtual bool ReconnectAsync ()
 Reconnect the client (asynchronous) More...
 
virtual size_t Send (const void *buffer, size_t size)
 Send data to the server (synchronous) More...
 
virtual size_t Send (std::string_view text)
 Send text to the server (synchronous) More...
 
virtual size_t Send (const void *buffer, size_t size, const CppCommon::Timespan &timeout)
 Send data to the server with timeout (synchronous) More...
 
virtual size_t Send (std::string_view text, const CppCommon::Timespan &timeout)
 Send text to the server with timeout (synchronous) More...
 
virtual bool SendAsync (const void *buffer, size_t size)
 Send data to the server (asynchronous) More...
 
virtual bool SendAsync (std::string_view text)
 Send text to the server (asynchronous) More...
 
virtual size_t Receive (void *buffer, size_t size)
 Receive data from the server (synchronous) More...
 
virtual std::string Receive (size_t size)
 Receive text from the server (synchronous) More...
 
virtual size_t Receive (void *buffer, size_t size, const CppCommon::Timespan &timeout)
 Receive data from the server with timeout (synchronous) More...
 
virtual std::string Receive (size_t size, const CppCommon::Timespan &timeout)
 Receive text from the server with timeout (synchronous) More...
 
virtual void ReceiveAsync ()
 Receive data from the server (asynchronous) More...
 
void SetupKeepAlive (bool enable) noexcept
 Setup option: keep alive. More...
 
void SetupNoDelay (bool enable) noexcept
 Setup option: no delay. 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...
 

Protected Member Functions

void onConnected () override
 Handle client connected notification. More...
 
void onDisconnected () override
 Handle client disconnected notification. More...
 
void onReceived (const void *buffer, size_t size) override
 Handle buffer received notification. More...
 
void onReceivedResponseHeader (const HTTP::HTTPResponse &response) override
 Handle HTTP response header received notification. More...
 
void onReceivedResponse (const HTTP::HTTPResponse &response) override
 Handle HTTP response received notification. More...
 
void onReceivedResponseError (const HTTP::HTTPResponse &response, const std::string &error) override
 Handle HTTP response 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...
 
- Protected Member Functions inherited from CppServer::Asio::TCPClient
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...
 
- Protected Member Functions inherited from CppServer::WS::WebSocket
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
 
WebSocketoperator= (const WebSocket &)=delete
 
WebSocketoperator= (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...
 

Additional Inherited Members

- Protected Attributes inherited from CppServer::HTTP::HTTPClient
HTTPRequest _request
 HTTP request. More...
 
HTTPResponse _response
 HTTP response. More...
 
- Protected Attributes inherited from CppServer::WS::WebSocket
bool _ws_handshaked {false}
 Handshaked flag. More...
 
uint8_t _ws_opcode
 Received frame opcode. More...
 
bool _ws_frame_received {false}
 Received frame flag. More...
 
bool _ws_final_received {false}
 Received final flag. More...
 
size_t _ws_header_size {0}
 Received frame header size. More...
 
size_t _ws_payload_size {0}
 Received frame payload size. More...
 
std::vector< uint8_t > _ws_receive_frame_buffer
 Receive frame buffer. More...
 
std::vector< uint8_t > _ws_receive_final_buffer
 Receive final buffer. More...
 
uint8_t _ws_receive_mask [4]
 Receive mask. More...
 
std::mutex _ws_send_lock
 Send buffer lock. More...
 
std::vector< uint8_t > _ws_send_buffer
 Send buffer. More...
 
uint8_t _ws_send_mask [4]
 Send mask. More...
 
std::array< uint8_t, 16 > _ws_nonce
 WebSocket random nonce of 16 bytes. More...
 
- Static Protected Attributes inherited from CppServer::WS::WebSocket
static const uint8_t WS_FIN = 0x80
 Final frame. More...
 
static const uint8_t WS_TEXT = 0x01
 Text frame. More...
 
static const uint8_t WS_BINARY = 0x02
 Binary frame. More...
 
static const uint8_t WS_CLOSE = 0x08
 Close frame. More...
 
static const uint8_t WS_PING = 0x09
 Ping frame. More...
 
static const uint8_t WS_PONG = 0x0A
 Pong frame. More...
 

Detailed Description

WebSocket client.

WebSocket client is used to communicate with WebSocket server.

https://en.wikipedia.org/wiki/WebSocket

Thread-safe.

Examples
ws_chat_client.cpp.

Definition at line 26 of file ws_client.h.

Constructor & Destructor Documentation

◆ WSClient() [1/2]

CppServer::WS::WSClient::WSClient ( const WSClient )
delete

◆ WSClient() [2/2]

CppServer::WS::WSClient::WSClient ( WSClient &&  )
delete

◆ ~WSClient()

virtual CppServer::WS::WSClient::~WSClient ( )
virtualdefault

Member Function Documentation

◆ Close() [1/4]

virtual bool CppServer::WS::WSClient::Close ( )
inlinevirtual

Definition at line 43 of file ws_client.h.

◆ Close() [2/4]

virtual bool CppServer::WS::WSClient::Close ( int  status)
inlinevirtual

Definition at line 44 of file ws_client.h.

◆ Close() [3/4]

virtual bool CppServer::WS::WSClient::Close ( int  status,
const void *  buffer,
size_t  size 
)
inlinevirtual

Definition at line 45 of file ws_client.h.

◆ Close() [4/4]

virtual bool CppServer::WS::WSClient::Close ( int  status,
std::string_view  text 
)
inlinevirtual

Definition at line 46 of file ws_client.h.

◆ CloseAsync() [1/4]

virtual bool CppServer::WS::WSClient::CloseAsync ( )
inlinevirtual
Examples
ws_chat_client.cpp.

Definition at line 47 of file ws_client.h.

◆ CloseAsync() [2/4]

virtual bool CppServer::WS::WSClient::CloseAsync ( int  status)
inlinevirtual

Definition at line 48 of file ws_client.h.

◆ CloseAsync() [3/4]

virtual bool CppServer::WS::WSClient::CloseAsync ( int  status,
const void *  buffer,
size_t  size 
)
inlinevirtual

Definition at line 49 of file ws_client.h.

◆ CloseAsync() [4/4]

virtual bool CppServer::WS::WSClient::CloseAsync ( int  status,
std::string_view  text 
)
inlinevirtual

Definition at line 50 of file ws_client.h.

◆ Connect() [1/2]

bool CppServer::WS::WSClient::Connect ( )
overridevirtual

Connect the client (synchronous)

Please note that synchronous connect will not receive data automatically! You should use Receive() or ReceiveAsync() method manually after successful connection.

Returns
'true' if the client was successfully connected, 'false' if the client failed to connect

Reimplemented from CppServer::Asio::TCPClient.

Definition at line 14 of file ws_client.cpp.

◆ Connect() [2/2]

bool CppServer::WS::WSClient::Connect ( const std::shared_ptr< Asio::TCPResolver > &  resolver)
override

Definition at line 20 of file ws_client.cpp.

◆ ConnectAsync() [1/2]

bool CppServer::WS::WSClient::ConnectAsync ( )
overridevirtual

Connect the client (asynchronous)

Returns
'true' if the client was successfully connected, 'false' if the client failed to connect

Reimplemented from CppServer::Asio::TCPClient.

Examples
ws_chat_client.cpp.

Definition at line 26 of file ws_client.cpp.

◆ ConnectAsync() [2/2]

bool CppServer::WS::WSClient::ConnectAsync ( const std::shared_ptr< Asio::TCPResolver > &  resolver)
override

Definition at line 32 of file ws_client.cpp.

◆ onConnected()

void CppServer::WS::WSClient::onConnected ( )
overrideprotectedvirtual

Handle client connected notification.

Reimplemented from CppServer::Asio::TCPClient.

Definition at line 38 of file ws_client.cpp.

◆ onDisconnected()

void CppServer::WS::WSClient::onDisconnected ( )
overrideprotectedvirtual

Handle client disconnected notification.

Reimplemented from CppServer::HTTP::HTTPClient.

Examples
ws_chat_client.cpp.

Definition at line 56 of file ws_client.cpp.

◆ onReceived()

void CppServer::WS::WSClient::onReceived ( const void *  buffer,
size_t  size 
)
overrideprotectedvirtual

Handle buffer received notification.

Notification is called when another part of buffer was received from the server.

Parameters
buffer- Received buffer
size- Received buffer size

Reimplemented from CppServer::HTTP::HTTPClient.

Definition at line 76 of file ws_client.cpp.

◆ onReceivedResponse()

void CppServer::WS::WSClient::onReceivedResponse ( const HTTP::HTTPResponse response)
overrideprotectedvirtual

Handle HTTP response received notification.

Notification is called when HTTP response was received from the server.

Parameters
response- HTTP response

Reimplemented from CppServer::HTTP::HTTPClient.

Definition at line 103 of file ws_client.cpp.

◆ onReceivedResponseError()

void CppServer::WS::WSClient::onReceivedResponseError ( const HTTP::HTTPResponse response,
const std::string &  error 
)
overrideprotectedvirtual

Handle HTTP response error notification.

Notification is called when HTTP response error was received from the server.

Parameters
response- HTTP response
error- HTTP response error

Reimplemented from CppServer::HTTP::HTTPClient.

Definition at line 117 of file ws_client.cpp.

◆ onReceivedResponseHeader()

void CppServer::WS::WSClient::onReceivedResponseHeader ( const HTTP::HTTPResponse response)
overrideprotectedvirtual

Handle HTTP response header received notification.

Notification is called when HTTP response header was received from the server.

Parameters
response- HTTP response

Reimplemented from CppServer::HTTP::HTTPClient.

Definition at line 89 of file ws_client.cpp.

◆ onWSClose()

void CppServer::WS::WSClient::onWSClose ( const void *  buffer,
size_t  size,
int  status = 1000 
)
inlineoverrideprotectedvirtual

Handle WebSocket close notification.

Reimplemented from CppServer::WS::WebSocket.

Definition at line 107 of file ws_client.h.

◆ onWSError()

void CppServer::WS::WSClient::onWSError ( const std::string &  message)
inlineoverrideprotectedvirtual

Handle WebSocket error notification.

Reimplemented from CppServer::WS::WebSocket.

Definition at line 111 of file ws_client.h.

◆ onWSPing()

void CppServer::WS::WSClient::onWSPing ( const void *  buffer,
size_t  size 
)
inlineoverrideprotectedvirtual

Handle WebSocket ping notification.

Reimplemented from CppServer::WS::WebSocket.

Definition at line 109 of file ws_client.h.

◆ operator=() [1/2]

WSClient& CppServer::WS::WSClient::operator= ( const WSClient )
delete

◆ operator=() [2/2]

WSClient& CppServer::WS::WSClient::operator= ( WSClient &&  )
delete

◆ ReceiveBinary() [1/2]

std::vector< uint8_t > CppServer::WS::WSClient::ReceiveBinary ( )

Definition at line 191 of file ws_client.cpp.

◆ ReceiveBinary() [2/2]

std::vector< uint8_t > CppServer::WS::WSClient::ReceiveBinary ( const CppCommon::Timespan &  timeout)

Definition at line 222 of file ws_client.cpp.

◆ ReceiveText() [1/2]

std::string CppServer::WS::WSClient::ReceiveText ( )

Definition at line 129 of file ws_client.cpp.

◆ ReceiveText() [2/2]

std::string CppServer::WS::WSClient::ReceiveText ( const CppCommon::Timespan &  timeout)

Definition at line 160 of file ws_client.cpp.

◆ SendBinary() [1/4]

size_t CppServer::WS::WSClient::SendBinary ( const void *  buffer,
size_t  size 
)
inline

Definition at line 61 of file ws_client.h.

◆ SendBinary() [2/4]

size_t CppServer::WS::WSClient::SendBinary ( const void *  buffer,
size_t  size,
const CppCommon::Timespan &  timeout 
)
inline

Definition at line 63 of file ws_client.h.

◆ SendBinary() [3/4]

size_t CppServer::WS::WSClient::SendBinary ( std::string_view  text)
inline

Definition at line 62 of file ws_client.h.

◆ SendBinary() [4/4]

size_t CppServer::WS::WSClient::SendBinary ( std::string_view  text,
const CppCommon::Timespan &  timeout 
)
inline

Definition at line 64 of file ws_client.h.

◆ SendBinaryAsync() [1/2]

bool CppServer::WS::WSClient::SendBinaryAsync ( const void *  buffer,
size_t  size 
)
inline

Definition at line 65 of file ws_client.h.

◆ SendBinaryAsync() [2/2]

bool CppServer::WS::WSClient::SendBinaryAsync ( std::string_view  text)
inline

Definition at line 66 of file ws_client.h.

◆ SendClose() [1/4]

size_t CppServer::WS::WSClient::SendClose ( int  status,
const void *  buffer,
size_t  size 
)
inline

Definition at line 69 of file ws_client.h.

◆ SendClose() [2/4]

size_t CppServer::WS::WSClient::SendClose ( int  status,
const void *  buffer,
size_t  size,
const CppCommon::Timespan &  timeout 
)
inline

Definition at line 71 of file ws_client.h.

◆ SendClose() [3/4]

size_t CppServer::WS::WSClient::SendClose ( int  status,
std::string_view  text 
)
inline

Definition at line 70 of file ws_client.h.

◆ SendClose() [4/4]

size_t CppServer::WS::WSClient::SendClose ( int  status,
std::string_view  text,
const CppCommon::Timespan &  timeout 
)
inline

Definition at line 72 of file ws_client.h.

◆ SendCloseAsync() [1/2]

bool CppServer::WS::WSClient::SendCloseAsync ( int  status,
const void *  buffer,
size_t  size 
)
inline

Definition at line 73 of file ws_client.h.

◆ SendCloseAsync() [2/2]

bool CppServer::WS::WSClient::SendCloseAsync ( int  status,
std::string_view  text 
)
inline

Definition at line 74 of file ws_client.h.

◆ SendPing() [1/4]

size_t CppServer::WS::WSClient::SendPing ( const void *  buffer,
size_t  size 
)
inline

Definition at line 77 of file ws_client.h.

◆ SendPing() [2/4]

size_t CppServer::WS::WSClient::SendPing ( const void *  buffer,
size_t  size,
const CppCommon::Timespan &  timeout 
)
inline

Definition at line 79 of file ws_client.h.

◆ SendPing() [3/4]

size_t CppServer::WS::WSClient::SendPing ( std::string_view  text)
inline

Definition at line 78 of file ws_client.h.

◆ SendPing() [4/4]

size_t CppServer::WS::WSClient::SendPing ( std::string_view  text,
const CppCommon::Timespan &  timeout 
)
inline

Definition at line 80 of file ws_client.h.

◆ SendPingAsync() [1/2]

bool CppServer::WS::WSClient::SendPingAsync ( const void *  buffer,
size_t  size 
)
inline

Definition at line 81 of file ws_client.h.

◆ SendPingAsync() [2/2]

bool CppServer::WS::WSClient::SendPingAsync ( std::string_view  text)
inline

Definition at line 82 of file ws_client.h.

◆ SendPong() [1/4]

size_t CppServer::WS::WSClient::SendPong ( const void *  buffer,
size_t  size 
)
inline

Definition at line 85 of file ws_client.h.

◆ SendPong() [2/4]

size_t CppServer::WS::WSClient::SendPong ( const void *  buffer,
size_t  size,
const CppCommon::Timespan &  timeout 
)
inline

Definition at line 87 of file ws_client.h.

◆ SendPong() [3/4]

size_t CppServer::WS::WSClient::SendPong ( std::string_view  text)
inline

Definition at line 86 of file ws_client.h.

◆ SendPong() [4/4]

size_t CppServer::WS::WSClient::SendPong ( std::string_view  text,
const CppCommon::Timespan &  timeout 
)
inline

Definition at line 88 of file ws_client.h.

◆ SendPongAsync() [1/2]

bool CppServer::WS::WSClient::SendPongAsync ( const void *  buffer,
size_t  size 
)
inline

Definition at line 89 of file ws_client.h.

◆ SendPongAsync() [2/2]

bool CppServer::WS::WSClient::SendPongAsync ( std::string_view  text)
inline

Definition at line 90 of file ws_client.h.

◆ SendText() [1/4]

size_t CppServer::WS::WSClient::SendText ( const void *  buffer,
size_t  size 
)
inline

Definition at line 53 of file ws_client.h.

◆ SendText() [2/4]

size_t CppServer::WS::WSClient::SendText ( const void *  buffer,
size_t  size,
const CppCommon::Timespan &  timeout 
)
inline

Definition at line 55 of file ws_client.h.

◆ SendText() [3/4]

size_t CppServer::WS::WSClient::SendText ( std::string_view  text)
inline

Definition at line 54 of file ws_client.h.

◆ SendText() [4/4]

size_t CppServer::WS::WSClient::SendText ( std::string_view  text,
const CppCommon::Timespan &  timeout 
)
inline

Definition at line 56 of file ws_client.h.

◆ SendTextAsync() [1/2]

bool CppServer::WS::WSClient::SendTextAsync ( const void *  buffer,
size_t  size 
)
inline

Definition at line 57 of file ws_client.h.

◆ SendTextAsync() [2/2]

bool CppServer::WS::WSClient::SendTextAsync ( std::string_view  text)
inline

Definition at line 58 of file ws_client.h.


The documentation for this class was generated from the following files: