本文整理汇总了C++中SocketEndpoint::equals方法的典型用法代码示例。如果您正苦于以下问题:C++ SocketEndpoint::equals方法的具体用法?C++ SocketEndpoint::equals怎么用?C++ SocketEndpoint::equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SocketEndpoint
的用法示例。
在下文中一共展示了SocketEndpoint::equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateDaliEnv
bool updateDaliEnv(IPropertyTree *env, bool forceGroupUpdate, const char *daliIp)
{
Owned<IPropertyTreeIterator> dalis = env->getElements("Software/DaliServerProcess/Instance");
if (!dalis||!dalis->first()) {
fprintf(stderr,"Could not find DaliServerProcess\n");
return false;
}
SocketEndpoint daliep;
loop {
const char *ps = dalis->get().queryProp("@port");
unsigned port = ps?atoi(ps):0;
if (!port)
port = DALI_SERVER_PORT;
daliep.set(dalis->get().queryProp("@netAddress"),port);
if (daliIp && *daliIp) {
SocketEndpoint testep;
testep.set(daliIp,DALI_SERVER_PORT);
if (testep.equals(daliep))
break;
daliep.set(NULL,0);
}
if (!dalis->next())
break;
if (!daliep.isNull()) {
fprintf(stderr,"Ambiguous DaliServerProcess instance\n");
return false;
}
}
if (daliep.isNull()) {
fprintf(stderr,"Could not find DaliServerProcess instance\n");
return false;
}
SocketEndpointArray epa;
epa.append(daliep);
Owned<IGroup> group = createIGroup(epa);
bool ret = true;
initClientProcess(group, DCR_Util);
StringBuffer response;
if (querySDS().updateEnvironment(env, forceGroupUpdate, response))
{
StringBuffer tmp;
PROGLOG("Environment and node groups updated in dali at %s",daliep.getUrlStr(tmp).str());
}
else
ret = false;
if (response.length())
WARNLOG("%s", response.str());
closedownClientProcess();
return ret;
}