socket.io-client-cpp icon indicating copy to clipboard operation
socket.io-client-cpp copied to clipboard

socket::impl::on_close always 3 seconds callback,could I change it to 1 second?

Open dragon8609 opened this issue 2 years ago • 0 comments

void socket::impl::close()
{
    NULL_GUARD(m_client);
    if(m_connected)
    {
        packet p(packet::type_disconnect,m_nsp);
        send_packet(p);

        if(!m_connection_timer)
        {
            m_connection_timer.reset(new asio::steady_timer(m_client->get_io_service()));
        }
        asio::error_code ec;
        m_connection_timer->expires_from_now(std::chrono::milliseconds(3000), ec);             //here is 3000 ms
        m_connection_timer->async_wait(std::bind(&socket::impl::on_close, this));
    }
}

I want to modify it like this: m_connection_timer->expires_from_now(std::chrono::milliseconds(1000), ec);

After that would make some problem?

dragon8609 avatar Feb 13 '23 02:02 dragon8609