sudonym1 / iperf

Automatically exported from code.google.com/p/iperf
Other
0 stars 0 forks source link

Can't get json from api #147

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What is the expected output? What do you see instead?

I'm trying to get json in widget, but i see nothing.

What version of the product are you using? On what operating system?

Qt4.8/Gcc 4.4

Please provide any additional information below.

void Worker::runTest(Test & tst) {
    test = iperf_new_test();
    iperf_defaults( test );
    iperf_set_test_role( test, 's' );
    iperf_set_test_server_port( test, Options::instance().m_port);
    iperf_set_verbose( test, Options::instance().m_verboseOut);
    iperf_set_test_json_output(test, Options::instance().m_jsonOut);
    iperf_set_test_reporter_interval( test, Options::instance().m_interval );
    Options::instance().save();
    if (iperf_run_server( test ) < 0) {
        QString strError = QString::fromAscii(iperf_strerror(i_errno));
        emit valueChanged(strError);
    } else {
        QString strResult = QString("iperf done");
        emit valueChanged(strResult);
    }

      QString msg;
      QTextStream s(&msg);
      s << "" << "\n";
      s << "Values:" << tst.n << "\n";
      emit valueChanged(msg);
      iperf_free_test(test);
      emit finished();
   }

Original issue reported on code.google.com by MikS...@gmail.com on 25 Feb 2014 at 9:57

GoogleCodeExporter commented 9 years ago
I admit that I haven't programmed with the API.  Does it give you meaningful 
output in non-JSON mode?

Note for future reference:  The code snippet is for running an iperf3 test in 
server mode.

Original comment by bmah@es.net on 27 Feb 2014 at 6:52