- try
- {
- auto name = xml_controller.first;
- auto protocol = xml_controller.second.get<std::wstring>(L"protocol");
-
- if(name == L"tcp")
- {
- unsigned int port = xml_controller.second.get(L"port", 5250);
- auto asyncbootstrapper = spl::make_shared<IO::AsyncEventServer>(
- io_service_,
- create_protocol(protocol, L"TCP Port " + boost::lexical_cast<std::wstring>(port)),
- port);
- async_servers_.push_back(asyncbootstrapper);
-
- if (!primary_amcp_server_ && boost::iequals(protocol, L"AMCP"))
- primary_amcp_server_ = asyncbootstrapper;
- }
- else
- CASPAR_LOG(warning) << "Invalid controller: " << name;
- }
- catch(...)
- {
- CASPAR_LOG_CURRENT_EXCEPTION();
+ auto name = xml_controller.first;
+ auto protocol = ptree_get<std::wstring>(xml_controller.second, L"protocol");
+
+ if(name == L"tcp")
+ {
+ auto port = ptree_get<unsigned int>(xml_controller.second, L"port");
+ auto asyncbootstrapper = spl::make_shared<IO::AsyncEventServer>(
+ io_service_,
+ create_protocol(protocol, L"TCP Port " + boost::lexical_cast<std::wstring>(port)),
+ port);
+ async_servers_.push_back(asyncbootstrapper);
+
+ if (!primary_amcp_server_ && boost::iequals(protocol, L"AMCP"))
+ primary_amcp_server_ = asyncbootstrapper;