Kurlyk
Toggle main menu visibility
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
8
namespace
kurlyk
{
9
12
class
WebSocketSendInfo
{
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
26
WebSocketSendInfo
(
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
)),
33
rate_limit_id
(
rate_limit_id
),
34
is_send_close
(
is_send_close
),
35
status
(
status
),
36
callback
(
std
::move(
callback
)) {}
37
};
38
39
}
// namespace kurlyk
40
41
#endif
// _KURLYK_WEBSOCKET_SEND_INFO_HPP_INCLUDED
kurlyk::WebSocketSendInfo::rate_limit_id
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...
Definition
WebSocketSendInfo.hpp:15
kurlyk::WebSocketSendInfo::callback
std::function< void(const std::error_code &)> callback
Callback invoked after sending, with error status.
Definition
WebSocketSendInfo.hpp:18
kurlyk::WebSocketSendInfo::is_send_close
bool is_send_close
Indicates if this message is a close request.
Definition
WebSocketSendInfo.hpp:16
kurlyk::WebSocketSendInfo::status
int status
Status code for the close request, default is normal closure (1000).
Definition
WebSocketSendInfo.hpp:17
kurlyk::WebSocketSendInfo::message
std::string message
Content of the WebSocket message to be sent.
Definition
WebSocketSendInfo.hpp:14
kurlyk::WebSocketSendInfo::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)
Constructs a WebSocketSendInfo instance with the specified parameters.
Definition
WebSocketSendInfo.hpp:26
kurlyk
Primary namespace for the Kurlyk library, encompassing initialization, request management,...
std
Enables use of ClientError with std::error_code.
Definition
ClientErrorCategory.hpp:69
include
kurlyk
websocket
data
WebSocketSendInfo.hpp
Generated by
1.17.0