|
| shard (asio::io_context &_io, websocketpp::client< websocketpp::config::asio_tls_client > &_ws, int32_t id) |
| Constructs a shard object for connecting to the websocket gateway and tracking timers.
|
|
void | do_reset (shard_status _status=shard_status::closed) noexcept |
| Resets connection, heartbeat, and timer related objects to allow reconnection.
|
|
int64_t | get_sequence () const noexcept |
| Get this shard's websocket message sequence counter. More...
|
|
int32_t | get_id () const noexcept |
| Gets the id of the shard in the master list. More...
|
|
bool | is_connected () const noexcept |
| Check if this shard has an active connection or is a connecting state. More...
|
|
bool | is_online () const noexcept |
| Check if this shard is ready to interact with the gateway. More...
|
|
void | send (const std::string &payload, websocketpp::frame::opcode::value op=websocketpp::frame::opcode::text) |
| Send a message to this shard's websocket connection asynchronously. More...
|
|
void | send_now (const std::string &payload, websocketpp::frame::opcode::value op=websocketpp::frame::opcode::text) |
| Send message over the websocket synchronously.
|
|
std::string | get_transfer_str () const noexcept |
| Returns a formatted string of bytes received since library start. More...
|
|
std::string | get_transfer_u_str () const noexcept |
| Returns a formatted string of uncompressed bytes received since library start. More...
|
|
uint64_t | get_transfer () const noexcept |
|
uint64_t | get_transfer_u () const noexcept |
|
void | connect () |
| Open websocket connection.
|
|
std::string | uptime_str () const noexcept |
| Return shard uptime as {days hours minutes seconds}. More...
|
|
int64_t | uptime () const noexcept |
| Return shard uptime as {days hours minutes seconds}. More...
|
|
void | set_heartbeat (std::function< void(const asio::error_code &, const std::chrono::milliseconds, shard *)> fnkeepalive) |
|
void | start_heartbeat (int32_t heartbeat) noexcept |
|
void | set_sequence (int64_t seq) noexcept |
|
void | set_id (int32_t shard_id) noexcept |
|
connection_ptr | get_connection () noexcept |
|
const std::vector< std::string > & | get_trace () const noexcept |
|
void | update_presence (const std::string &text, gateway::objects::activity::activity_type type=gateway::objects::activity::Game, gateway::objects::presence::user_status status=gateway::objects::presence::Online) |
| Update presence on this shard. More...
|
|
|
struct { |
int64_t messages |
|
int64_t presence_changes |
|
int64_t reconnects |
|
} | counters = { 0,0,0 } |
| Contains counters of valued objects and events.
|
|
asio::steady_timer | keepalivetimer |
|
asio::steady_timer | delayedauth |
|
asio::steady_timer | write_timer |
|
std::queue< std::tuple
< std::string,
websocketpp::frame::opcode::value > > | write_queue |
|
int32_t | heartbeattime |
|
std::chrono::steady_clock::time_point | heartbeat_ack |
|
std::chrono::steady_clock::time_point | lastheartbeat |
|
std::chrono::steady_clock::time_point | lastwsevent |
|
std::chrono::steady_clock::time_point | last_status_time |
|
std::chrono::steady_clock::time_point | _ready_time |
|
std::chrono::steady_clock::time_point | last_ws_write |
|
std::chrono::steady_clock::time_point | connect_time |
|
std::chrono::steady_clock::time_point | closing_time |
|
shard_status | connection_state |
|
std::string | session_id |
|
std::function< void(const
asio::error_code &, const
std::chrono::milliseconds,
shard *)> | keepalivefunc |
|
Tracks websocket shards and their connections.