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

QRemoteObjectHost::setHostUrl(...) returns true even if listen fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.11.1
    • Remote Objects
    • None
    • Windows

    Description

      Calling QRemoteObjectHost::setHostUrl(...) with a port that is already in use returns true which I consider a bug.

      If m_server is created but listen fails warnings are emitted but success will be returned. The using call is only checking whether m_server could be created (not null), not that listen() succeeded.

      QT Source Code:

      QRemoteObjectSourceIo::QRemoteObjectSourceIo(const QUrl &address, QObject *parent)
          : QObject(parent)
          , m_server(QtROServerFactory::instance()->create(address, this))
      {
          if (m_server && m_server->listen(address)) { 
              qRODebug(this) << "QRemoteObjectSourceIo is Listening" << address;
          } else {
              qROWarning(this) << "Listen failed for URL:" << address;
              if (m_server)
                  qROWarning(this) << m_server->serverError();
              else
                  qROWarning(this) << "Most likely an unrecognized scheme was used.";
              return;
          }
      
          connect(m_server.data(), &QConnectionAbstractServer::newConnection, this, &QRemoteObjectSourceIo::handleConnection);
      }
      

      Attachments

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

        Activity

          People

            bstottle Brett Stottlemyer
            __henning__ Henning Voss
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes