本文整理汇总了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;
}
}