Example #1
0
File: ccc.cpp Project: hanpfei/hudt
const CPerfMon* CCC::getPerfInfo() {
    try {
        CUDT* u = CUDT::getUDTHandle(m_UDT);
        if (NULL != u)
            u->sample(&m_PerfInfo, false);
    } catch (...) {
        return NULL;
    }

    return &m_PerfInfo;
}
Example #2
0
int CUDT::perfmon(UDTSOCKET u, CPerfMon* perf, bool clear)
{
   try
   {
      CUDT* udt = s_UDTUnited.lookup(u);
      udt->sample(perf, clear);
      return 0;
   }
   catch (CUDTException e)
   {
      s_UDTUnited.setError(new CUDTException(e));
      return ERROR;
   }
   catch (...)
   {
      s_UDTUnited.setError(new CUDTException(-1, 0, 0));
      return ERROR;
   }
}