Schedule a reconnect attempt after the configured interval.
566{
567 if (!conn.reconnect_timer) {
568 conn.reconnect_timer = std::make_unique<asio::steady_timer>(
m_context);
569 }
570
571 conn.reconnect_timer->expires_after(
573
574 conn.reconnect_timer->async_wait(
575 [this, ep_id = conn.info.id](const asio::error_code& ec) {
576 if (ec == asio::error::operation_aborted) {
577 return;
578 }
579
583 return;
584 }
585
586 auto& c = *it->second;
587
588 c.socket = asio::ip::tcp::socket(
m_context);
589
591 "TCP endpoint {} attempting reconnect to {}:{}",
592 ep_id, c.info.remote_address, c.info.remote_port);
593
595 });
596}
#define MF_DEBUG(comp, ctx,...)
void start_connect(ConnectionState &conn)
Initiate async_connect for an outbound endpoint.
std::unordered_map< uint64_t, std::unique_ptr< ConnectionState > > m_connections
std::shared_mutex m_connections_mutex
asio::io_context & m_context
@ NetworkBackend
Network transport backend (UDP, TCP, SHM)
@ Core
Core engine, backend, subsystems.
uint32_t reconnect_interval_ms