#include <Gateway.h>
|
std::shared_ptr< Threadpool > | threadpool |
| the threadpool used for tasks handling messages
|
|
boost::asio::io_context | io_context |
| boost io context used by the websocket client
|
|
boost::asio::ssl::context | ssl_context |
| ssl context used by the websocket client
|
|
std::unique_ptr< boost::beast::websocket::stream< boost::beast::ssl_stream< boost::asio::ip::tcp::socket > > > | _client |
| websocket client
|
|
std::string | _url |
| the url of the gateway
|
|
std::string | _resume_url |
| the url used for reconnecting
|
|
std::string | _token |
| token to identify with the gateway
|
|
unsigned int | _heartbeat_interval |
| heartbeat interval in milliseconds
|
|
bool | _keepalive |
| wether to keep the websocket alive or not
|
|
unsigned int | _reconnect_timeout |
| sometimes it is better a few seconds before reconnecting...
|
|
time_t | _last_heartbeat_ack = 0 |
| timestamp of last heartbeat ack
|
|
std::thread | _heartbeat_task |
| heartbeat task
|
|
bool | _connected |
| indicator if Gateway is connected
|
|
Logger | _log |
| logging instance
|
|
std::function< void(json payload)> | _message_handler |
| the message handler set by using set_message_handler
|
|
◆ Gateway()
DiscordCPP::Gateway::Gateway |
( |
std::string | token, |
|
|
const std::shared_ptr< Threadpool > & | threadpool ) |
◆ ~Gateway()
DiscordCPP::Gateway::~Gateway |
( |
| ) |
|
|
virtual |
◆ close()
◆ connect()
◆ get_heartbeat_payload()
virtual json DiscordCPP::Gateway::get_heartbeat_payload |
( |
| ) |
|
|
protectedpure virtual |
◆ identify()
virtual void DiscordCPP::Gateway::identify |
( |
| ) |
|
|
protectedpure virtual |
◆ on_websocket_disconnnect()
void DiscordCPP::Gateway::on_websocket_disconnnect |
( |
| ) |
|
|
protected |
◆ on_websocket_incoming_message()
virtual void DiscordCPP::Gateway::on_websocket_incoming_message |
( |
const std::string & | message | ) |
|
|
protectedpure virtual |
◆ send()
◆ set_message_handler()
void DiscordCPP::Gateway::set_message_handler |
( |
const std::function< void(json payload)> & | handler | ) |
|
◆ start_heartbeating()
void DiscordCPP::Gateway::start_heartbeating |
( |
| ) |
|
|
protected |
◆ _client
std::unique_ptr<boost::beast::websocket::stream<boost::beast::ssl_stream<boost::asio::ip::tcp::socket> > > DiscordCPP::Gateway::_client |
|
protected |
◆ _connected
bool DiscordCPP::Gateway::_connected |
|
protected |
◆ _heartbeat_interval
unsigned int DiscordCPP::Gateway::_heartbeat_interval |
|
protected |
heartbeat interval in milliseconds
◆ _heartbeat_task
std::thread DiscordCPP::Gateway::_heartbeat_task |
|
protected |
◆ _keepalive
bool DiscordCPP::Gateway::_keepalive |
|
protected |
wether to keep the websocket alive or not
◆ _last_heartbeat_ack
time_t DiscordCPP::Gateway::_last_heartbeat_ack = 0 |
|
protected |
timestamp of last heartbeat ack
◆ _log
Logger DiscordCPP::Gateway::_log |
|
protected |
◆ _message_handler
std::function<void(json payload)> DiscordCPP::Gateway::_message_handler |
|
protected |
the message handler set by using set_message_handler
◆ _reconnect_timeout
unsigned int DiscordCPP::Gateway::_reconnect_timeout |
|
protected |
sometimes it is better a few seconds before reconnecting...
◆ _resume_url
std::string DiscordCPP::Gateway::_resume_url |
|
protected |
the url used for reconnecting
◆ _token
std::string DiscordCPP::Gateway::_token |
|
protected |
token to identify with the gateway
◆ _url
std::string DiscordCPP::Gateway::_url |
|
protected |
◆ io_context
boost::asio::io_context DiscordCPP::Gateway::io_context |
|
protected |
boost io context used by the websocket client
◆ ssl_context
boost::asio::ssl::context DiscordCPP::Gateway::ssl_context |
|
protected |
ssl context used by the websocket client
◆ threadpool
std::shared_ptr<Threadpool> DiscordCPP::Gateway::threadpool |
|
protected |
the threadpool used for tasks handling messages
The documentation for this class was generated from the following files: