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

QLocalSocket never emits ConnectedState in Linux

XMLWordPrintable

    • Linux/X11
    • a2cc86c4e (dev), b2e195dd6 (6.10), a8a49e9d2 (6.9), 7b8c01996 (tqtc/lts-6.8)

      If one overrides QLocalServer::incomingConnection() to accept the incoming connection by creating their own socket derived from QLocalSocket, and when QLocalSocket::setSocketDescriptor() is called in the override, then stateChanged(QLocalSocket::ConnectedState) is never emitted in Linux.  It is always emitted in Windows.  It appears that in the Linux implementation, a QAbstractSocket is used as the backend implementation.  However, it also appears that the state of the that socket is already set to Connected by the time the backend QAbstractSocket gets into QAbstractSocket::setSocketDescriptor and thus the signal is not emitted (since it doesn't think the state has changed).  On Windows, the backend is not a QAbstractSocket (since it's a named pipe) and the signal is unconditionally always emitted.  For code that relies on this signal, it does not work correctly in Linux.

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

            manordheim Mårten Nordheim
            nexus1701 Chad Marlow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: