Kurlyk
Loading...
Searching...
No Matches
kurlyk::WebSocketSendInfo Class Reference

Holds information for sending a WebSocket message, including rate limiting, close status, and a callback. More...

#include <WebSocketSendInfo.hpp>

Public Member Functions

 WebSocketSendInfo (std::string message, long rate_limit_id=0, bool is_send_close=false, int status=1000, std::function< void(const std::error_code &)> callback=nullptr)
 Constructs a WebSocketSendInfo instance with the specified parameters.
 

Public Attributes

std::string message
 Content of the WebSocket message to be sent.
 
long rate_limit_id = 0
 Rate limit ID applied to the message. A value of 0 implies the default rate limit or no limit if unspecified.
 
bool is_send_close = false
 Indicates if this message is a close request.
 
int status = 1000
 Status code for the close request, default is normal closure (1000).
 
std::function< void(const std::error_code &)> callback
 Callback invoked after sending, with error status.
 

Detailed Description

Holds information for sending a WebSocket message, including rate limiting, close status, and a callback.

Definition at line 12 of file WebSocketSendInfo.hpp.

Constructor & Destructor Documentation

◆ WebSocketSendInfo()

kurlyk::WebSocketSendInfo::WebSocketSendInfo ( std::string message,
long rate_limit_id = 0,
bool is_send_close = false,
int status = 1000,
std::function< void(const std::error_code &)> callback = nullptr )
inline

Constructs a WebSocketSendInfo instance with the specified parameters.

Parameters
messageContent of the WebSocket message to be sent.
rate_limit_idID for rate limiting the message. A value of 0 applies the default rate limit, or no limit if unspecified.
is_send_closeTrue if the message is a close request, false otherwise.
statusStatus code for the close request; default is 1000 (normal closure).
callbackCallback function to be called upon completion of the send operation.

Definition at line 26 of file WebSocketSendInfo.hpp.

Member Data Documentation

◆ callback

std::function<void(const std::error_code&)> kurlyk::WebSocketSendInfo::callback

Callback invoked after sending, with error status.

Definition at line 18 of file WebSocketSendInfo.hpp.

◆ is_send_close

bool kurlyk::WebSocketSendInfo::is_send_close = false

Indicates if this message is a close request.

Definition at line 16 of file WebSocketSendInfo.hpp.

◆ message

std::string kurlyk::WebSocketSendInfo::message

Content of the WebSocket message to be sent.

Definition at line 14 of file WebSocketSendInfo.hpp.

◆ rate_limit_id

long kurlyk::WebSocketSendInfo::rate_limit_id = 0

Rate limit ID applied to the message. A value of 0 implies the default rate limit or no limit if unspecified.

Definition at line 15 of file WebSocketSendInfo.hpp.

◆ status

int kurlyk::WebSocketSendInfo::status = 1000

Status code for the close request, default is normal closure (1000).

Definition at line 17 of file WebSocketSendInfo.hpp.


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