Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dragon8609 opened this issue Feb 13, 2023 · 0 comments

Comments

@dragon8609
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant