test/ttimeout.cc
/// Try to establish connection. This might fail, but
/// do not throw an error--just return false.
///
Try to establish connection. This might fail, but
do not throw an error--just return false.
Try to establish connection . This might fail but do not throw an error -- just return false .
bool tclient::connect()
{
    try {
        tcp::resolver resolver(m_io_service);
        boost::asio::connect(m_socket, resolver.resolve({m_host, m_service}));
        m_connected = true;
    }
    catch (std::exception &e) {
        std::cerr << "tclient connect: " << e.what();
        m_connected = false;
    }
    return m_connected;
}
bool tclient :: connect ( ) { try { tcp :: resolver resolver ( m_io_service ) ; boost :: asio :: connect ( m_socket , resolver . resolve ( { m_host , m_service } ) ) ; m_connected = true ; } catch ( std :: exception & e ) { std :: cerr << " " << e . what ( ) ; m_connected = false ; } return m_connected ; }
Try to establish connection.
Try to establish connection .
// 1. Connection refused