コード例 #1
0
ファイル: Launch.cpp プロジェクト: apietila/iperf-ng
/*
 * client_init handles multiple threaded connects. It creates
 * a listener object if either the dual test or tradeoff were
 * specified. It also creates settings structures for all the
 * threads and arranges them so they can be managed and started
 * via the one settings structure that was passed in.
 */
void client_init( thread_Settings *clients ) {
    thread_Settings *itr = NULL;
    thread_Settings *list = NULL;
    thread_Settings *next = NULL;

    // Set the first thread to report Settings (except cli side Reverse)
    setReport( clients );
    if (clients->mMode == kTest_Reverse && !isOnServer(clients)) {
      unsetReport( clients );
    }
    itr = clients;

    // See if we need to start a listener as well
    Settings_GenerateListenerSettings( clients, &list );

    // Create a multiple report header to handle reporting the
    // sum of multiple client threads
    Mutex_Lock( &groupCond );
    groupID--;
    clients->multihdr = InitMulti( clients, groupID );
    Mutex_Unlock( &groupCond );

#ifdef HAVE_THREAD
    if ( list != NULL && !isNAT(list)) {
        // We have threads and we need to start a listener so
        // have it ran before the client is launched (unless behind NAT)
        itr->runNow = list;
        itr = list;
    }
#endif
    // For each of the needed threads create a copy of the
    // provided settings, unsetting the report flag and add
    // to the list of threads to start
    for (int i = 1; i < clients->mThreads; i++) {
        Settings_Copy( clients, &next );
        unsetReport( next );
        itr->runNow = next;
        itr = next;
    }
#ifndef HAVE_THREAD
    if ( list != NULL ) {
        // We don't have threads and we need to start a listener so
        // have it ran after the client is finished
        itr->runNext = list;
    }
#else
    if ( list != NULL && isNAT(list) ) {
        // We have threads and we need to start a listener so
        // have it ran after the client is launched (when behind NAT)
        itr->runNext = list;
    }
#endif
}
コード例 #2
0
ファイル: client-test.cpp プロジェクト: ruphy/kfunambol
            RawFileSyncSourceWithReport(const char* nodeName, const WCHAR* name, SyncSourceConfig* sc) :
                RawFileSyncSource(name, sc),
                fileNode(nodeName) {
                setReport(&report);
                setFileNode(&fileNode);
                /*
                 * Keeping track if changes is done via time() with a resolution of seconds.
                 * Sleep a bit to ensure that enough time passes.
                 */
#ifdef WIN32
        Sleep(1000);
#else
                sleep(1);
#endif
            }
コード例 #3
0
ListBoxReportItem::ListBoxReportItem( Q3ListBox* listbox, const QString &name, int grade, Q3ListBoxItem *after )
    : Q3ListBoxText( listbox, name, after )
{
  _grade = grade;
  setReport( name );
}
コード例 #4
0
ListBoxReportItem::ListBoxReportItem( const QString &name , int grade)
    :Q3ListBoxText( name )
{
  _grade = grade;
  setReport( name );
}