Kurlyk
Loading...
Searching...
No Matches
WebSocketSendInfo.hpp
Go to the documentation of this file.
1#pragma once
2#ifndef _KURLYK_WEBSOCKET_SEND_INFO_HPP_INCLUDED
3#define _KURLYK_WEBSOCKET_SEND_INFO_HPP_INCLUDED
4
7
8namespace kurlyk {
9
13 public:
14 std::string message;
15 long rate_limit_id = 0;
16 bool is_send_close = false;
17 int status = 1000;
18 std::function<void(const std::error_code&)> callback;
19
27 std::string message,
28 long rate_limit_id = 0,
29 bool is_send_close = false,
30 int status = 1000,
31 std::function<void(const std::error_code&)> callback = nullptr) :
32 message(std::move(message)),
36 callback(std::move(callback)) {}
37 };
38
39} // namespace kurlyk
40
41#endif // _KURLYK_WEBSOCKET_SEND_INFO_HPP_INCLUDED
long rate_limit_id
Rate limit ID applied to the message. A value of 0 implies the default rate limit or no limit if unsp...
std::function< void(const std::error_code &)> callback
Callback invoked after sending, with error status.
bool is_send_close
Indicates if this message is a close request.
int status
Status code for the close request, default is normal closure (1000).
std::string message
Content of the WebSocket message to be sent.
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.
Primary namespace for the Kurlyk library, encompassing initialization, request management,...
Enables use of ClientError with std::error_code.