当前位置: 首页>>代码示例>>C++>>正文


C++ ConfigVariable::get_val方法代码示例

本文整理汇总了C++中ConfigVariable::get_val方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigVariable::get_val方法的具体用法?C++ ConfigVariable::get_val怎么用?C++ ConfigVariable::get_val使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConfigVariable的用法示例。


在下文中一共展示了ConfigVariable::get_val方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: init_network

void MessageDirector::init_network()
{
    if(!m_initialized)
    {
        // Bind to port and listen for downstream servers
        if(bind_addr.get_val() != "unspecified")
        {
            m_log.info() << "Opening listening socket..." << std::endl;

            TcpAcceptorCallback callback = std::bind(&MessageDirector::handle_connection,
                                           this, std::placeholders::_1);
            m_net_acceptor = new TcpAcceptor(io_service, callback);
            boost::system::error_code ec;
            ec = m_net_acceptor->bind(bind_addr.get_val(), 7199);
            if(ec.value() != 0)
            {
                m_log.fatal() << "Could not bind listening port: "
                              << bind_addr.get_val() << std::endl;
                m_log.fatal() << "Error code: " << ec.value()
                              << "(" << ec.category().message(ec.value()) << ")"
                              << std::endl;
                exit(1);
            }
            m_net_acceptor->start();
        }

        // Connect to upstream server and start handling received messages
        if(connect_addr.get_val() != "unspecified")
        {
            m_log.info() << "Connecting upstream..." << std::endl;

            MDNetworkUpstream *upstream = new MDNetworkUpstream(this);

            boost::system::error_code ec;
            upstream->connect(connect_addr.get_val());
            if(ec.value() != 0)
            {
                m_log.fatal() << "Could not connect to remote MD at IP: "
                              << connect_addr.get_val() << std::endl;
                m_log.fatal() << "Error code: " << ec.value()
                              << "(" << ec.category().message(ec.value()) << ")"
                              << std::endl;
                exit(1);
            }

            m_upstream = upstream;
        }

        if(threaded_mode.get_val())
        {
            m_thread = new std::thread(std::bind(&MessageDirector::routing_thread, this));
        }

        m_initialized = true;
    }
}
开发者ID:robert1111,项目名称:Astron,代码行数:56,代码来源:MessageDirector.cpp


注:本文中的ConfigVariable::get_val方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。