本文整理汇总了C++中SocketEndpoint::isLocal方法的典型用法代码示例。如果您正苦于以下问题:C++ SocketEndpoint::isLocal方法的具体用法?C++ SocketEndpoint::isLocal怎么用?C++ SocketEndpoint::isLocal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SocketEndpoint
的用法示例。
在下文中一共展示了SocketEndpoint::isLocal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkLocalDaFileSvr
bool CDfuPlusHelper::checkLocalDaFileSvr(const char *eps,SocketEndpoint &epout)
{
if (!eps||!*eps)
epout.setLocalHost(DAFILESRV_PORT);
else {
epout.set(eps,DAFILESRV_PORT);
if (!epout.isLocal())
return false;
}
progress("Checking for local Dali File Server\n");
if (!testDaliServixPresent(epout)) // only lookup local
runLocalDaFileSvr(epout,false,0);
return true;
}
示例2: deserializeAction
void TransferServer::deserializeAction(MemoryBuffer & msg, unsigned action)
{
SocketEndpoint ep;
ep.deserialize(msg);
if (!ep.isLocal())
{
StringBuffer host, expected;
queryHostIP().getIpText(host);
ep.getIpText(expected);
throwError2(DFTERR_WrongComputer, expected.str(), host.str());
}
srcFormat.deserialize(msg);
tgtFormat.deserialize(msg);
msg.read(calcInputCRC);
msg.read(calcOutputCRC);
deserialize(partition, msg);
msg.read(numParallelSlaves);
msg.read(updateFrequency);
msg.read(replicate);
msg.read(mirror);
msg.read(isSafeMode);
srand((unsigned)get_cycles_now());
int adjust = (rand() * rand() * rand()) % updateFrequency - (updateFrequency/2);
lastTick = msTick() + adjust;
StringBuffer localFilename;
if (action == FTactionpull)
{
partition.item(0).outputName.getPath(localFilename);
LOG(MCdebugProgress, unknownJob, "Process Pull Command: %s", localFilename.str());
}
else
{
partition.item(0).inputName.getPath(localFilename);
LOG(MCdebugProgress, unknownJob, "Process Push Command: %s", localFilename.str());
}
LOG(MCdebugProgress, unknownJob, "Num Parallel Slaves=%d Adjust=%d/%d", numParallelSlaves, adjust, updateFrequency);
LOG(MCdebugProgress, unknownJob, "replicate(%d) mirror(%d) safe(%d) incrc(%d) outcrc(%d)", replicate, mirror, isSafeMode, calcInputCRC, calcOutputCRC);
displayPartition(partition);
unsigned numProgress;
msg.read(numProgress);
for (unsigned i = 0; i < numProgress; i++)
{
OutputProgress & next = *new OutputProgress;
next.deserializeCore(msg);
progress.append(next);
}
if (msg.remaining())
msg.read(throttleNicSpeed);
if (msg.remaining())
msg.read(compressedInput).read(compressOutput);
if (msg.remaining())
msg.read(copyCompressed);
if (msg.remaining())
msg.read(transferBufferSize);
if (msg.remaining())
msg.read(encryptKey).read(decryptKey);
if (msg.remaining())
{
srcFormat.deserializeExtra(msg, 1);
tgtFormat.deserializeExtra(msg, 1);
}
ForEachItemIn(i1, progress)
progress.item(i1).deserializeExtra(msg, 1);
LOG(MCdebugProgress, unknownJob, "throttle(%d), transferBufferSize(%d)", throttleNicSpeed, transferBufferSize);
PROGLOG("compressedInput(%d), compressedOutput(%d), copyCompressed(%d)", compressedInput?1:0, compressOutput?1:0, copyCompressed?1:0);
PROGLOG("encrypt(%d), decrypt(%d)", encryptKey.isEmpty()?0:1, decryptKey.isEmpty()?0:1);
//---Finished deserializing ---
displayProgress(progress);
totalLengthRead = 0;
totalLengthToRead = 0;
ForEachItemIn(idx, partition)
totalLengthToRead += partition.item(idx).inputLength;
}