本文整理汇总了C++中passenger::AgentsStarter类的典型用法代码示例。如果您正苦于以下问题:C++ AgentsStarter类的具体用法?C++ AgentsStarter怎么用?C++ AgentsStarter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AgentsStarter类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: catch
int
psg_agents_starter_start(PSG_AgentsStarter *as,
const char *passengerRoot,
PSG_VariantMap *extraParams,
const PSG_AfterForkCallback afterFork,
void *callbackArgument,
char **errorMessage)
{
Passenger::AgentsStarter *agentsStarter = (Passenger::AgentsStarter *) as;
this_thread::disable_syscall_interruption dsi;
try {
function<void ()> afterForkFunctionObject;
if (afterFork != NULL) {
afterForkFunctionObject = boost::bind(afterFork, callbackArgument);
}
agentsStarter->start(passengerRoot,
*((Passenger::VariantMap *) extraParams),
afterForkFunctionObject);
return 1;
} catch (const Passenger::SystemException &e) {
errno = e.code();
*errorMessage = strdup(e.what());
return 0;
} catch (const std::exception &e) {
errno = -1;
*errorMessage = strdup(e.what());
return 0;
}
}
示例2:
const char *
psg_agents_starter_get_request_socket_password(PSG_AgentsStarter *as, unsigned int *size) {
Passenger::AgentsStarter *agentsStarter = (Passenger::AgentsStarter *) as;
if (size != NULL) {
*size = agentsStarter->getRequestSocketPassword().size();
}
return agentsStarter->getRequestSocketPassword().c_str();
}
示例3:
const char *
pp_agents_starter_get_instance_dir(PP_AgentsStarter *as, unsigned int *size) {
Passenger::AgentsStarter *agentsStarter = (Passenger::AgentsStarter *) as;
if (size != NULL) {
*size = agentsStarter->getInstanceDir().size();
}
return agentsStarter->getInstanceDir().c_str();
}
示例4:
const char *
agents_starter_get_request_socket_filename(AgentsStarter *as, unsigned int *size) {
Passenger::AgentsStarter *agentsStarter = (Passenger::AgentsStarter *) as;
if (size != NULL) {
*size = agentsStarter->getRequestSocketFilename().size();
}
return agentsStarter->getRequestSocketFilename().c_str();
}
示例5: catch
int
agents_starter_start(AgentsStarter *as,
int logLevel, const char *debugLogFile,
pid_t webServerPid,
const char *tempDir, int userSwitching,
const char *defaultUser, const char *defaultGroup,
uid_t webServerWorkerUid, gid_t webServerWorkerGid,
const char *passengerRoot,
const char *rubyCommand, unsigned int maxPoolSize,
unsigned int maxInstancesPerApp,
unsigned int poolIdleTime,
const char *analyticsServer,
const char *analyticsLogDir, const char *analyticsLogUser,
const char *analyticsLogGroup, const char *analyticsLogPermissions,
const char *unionStationGatewayAddress,
unsigned short unionStationGatewayPort,
const char *unionStationGatewayCert,
const char *unionStationProxyAddress,
const char *unionStationProxyType,
const char **prestartURLs, unsigned int prestartURLsCount,
const AfterForkCallback afterFork,
void *callbackArgument,
char **errorMessage)
{
Passenger::AgentsStarter *agentsStarter = (Passenger::AgentsStarter *) as;
this_thread::disable_syscall_interruption dsi;
try {
function<void ()> afterForkFunctionObject;
set<string> setOfprestartURLs;
unsigned int i;
if (afterFork != NULL) {
afterForkFunctionObject = boost::bind(afterFork, callbackArgument);
}
for (i = 0; i < prestartURLsCount; i++) {
setOfprestartURLs.insert(prestartURLs[i]);
}
agentsStarter->start(logLevel, debugLogFile,
webServerPid, tempDir, userSwitching,
defaultUser, defaultGroup,
webServerWorkerUid, webServerWorkerGid,
passengerRoot, rubyCommand,
maxPoolSize, maxInstancesPerApp, poolIdleTime,
analyticsServer,
analyticsLogDir, analyticsLogUser,
analyticsLogGroup, analyticsLogPermissions,
unionStationGatewayAddress,
unionStationGatewayPort,
unionStationGatewayCert,
unionStationProxyAddress,
unionStationProxyType,
setOfprestartURLs,
afterForkFunctionObject);
return 1;
} catch (const Passenger::SystemException &e) {
errno = e.code();
*errorMessage = strdup(e.what());
return 0;
} catch (const std::exception &e) {
errno = -1;
*errorMessage = strdup(e.what());
return 0;
}
}