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

"QLocalSocket::waitForDisconnected() is not allowed in UnconnectedState" error shown with the code from the QLocalSocket documentation

XMLWordPrintable

    • 2d680b27f3c56aacbec3191f38b7b1898c8747b1 (qt/qtbase/5.13)

      If one follows the code example in QLocalSocket::waitForDisconnected() and do:

      socket->disconnectFromServer();
      if (socket->waitForDisconnected(1000))
          qDebug("Disconnected!");
      

      It gives an error:
      "QLocalSocket::waitForDisconnected() is not allowed in UnconnectedState"

      on Windows.

      Could it be that the state is changed too early before waitForDisconnected() has returned?

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

            kari.oikarinen Kari Oikarinen
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes