Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-15976

qnetworksession->waitForOpened broken?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 4.8.x
    • None
    • Symbian^3, n8, Qt from git

      This code works fine:

      QCoreApplication app(argc, argv);
      QNetworkConfigurationManager configurationManager;
      QNetworkConfiguration configuration = configurationManager.defaultConfiguration();
      QNetworkSession *session = new QNetworkSession(configuration);
      QEventLoop loop;
      QObject::connect(session, SIGNAL(opened()), &loop, SLOT(quit()), Qt::QueuedConnection);
      QMetaObject::invokeMethod(session, "open", Qt::QueuedConnection);
      loop.exec();
      Q_ASSERT(session->isOpen());
      

      This code does not work:

      QCoreApplication ap(argc, argv);
      QNetworkConfigurationManager configurationManager;
      QNetworkConfiguration configuration = configurationManager.defaultConfiguration();
      QNetworkSession *session = new QNetworkSession(configuration);
      session->open();
      session->waitForOpened();
      Q_ASSERT(session->isOpen());
      

      I just get an unknown session error when using waitForOpened like that.
      I am asuming this is related to not having an active scheduler.
      If yes, the bearer code could could (should? create its own active scheduler and do the thing thing when opening the connection? Or there might be synchronous functions for the Symbian bearer API?

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            sikylmal Sipi Kylmälä
            mgoetz Markus Goetz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes