当前位置: 首页>>代码示例>>C++>>正文


C++ SocketEndpoint::getIpText方法代码示例

本文整理汇总了C++中SocketEndpoint::getIpText方法的典型用法代码示例。如果您正苦于以下问题:C++ SocketEndpoint::getIpText方法的具体用法?C++ SocketEndpoint::getIpText怎么用?C++ SocketEndpoint::getIpText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SocketEndpoint的用法示例。


在下文中一共展示了SocketEndpoint::getIpText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetServerAddr

 void SetServerAddr(SocketEndpoint &endpoint)
 {
     free(hostname);
     StringBuffer ipname;
     endpoint.getIpText(ipname);
     hostname = strdup(ipname.str());
     hostport = endpoint.port;
 }
开发者ID:AttilaVamos,项目名称:HPCC-Platform,代码行数:8,代码来源:hrpcsock.cpp

示例2: Bind

 virtual void Bind(SocketEndpoint &endpoint,int qsize)
 {
     if (serversock) {
         serversock->Release();
         serversock = NULL;
     }
     try {
         StringBuffer ipname;
         endpoint.getIpText(ipname);
         serversock = ISocket::create_ip(endpoint.port,ipname.str(),qsize);
     }
     catch (IJSOCK_Exception *e) {
         int hrpcerr;
         switch (e->errorCode()) {
         case JSOCKERR_port_in_use:          hrpcerr = HRPCERR_transport_port_in_use;    break;
         default:
             throw;
         }
         THROWHRPCEXCEPTIONEXC(hrpcerr,e);
         e->Release();
     }
     assertex(serversock);
 }
开发者ID:AttilaVamos,项目名称:HPCC-Platform,代码行数:23,代码来源:hrpcsock.cpp

示例3: 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;
}
开发者ID:lcamhoa,项目名称:HPCC-Platform,代码行数:82,代码来源:fttransform.cpp


注:本文中的SocketEndpoint::getIpText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。