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

QLocalSocket never emits ConnectedState in Linux

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.9.1
    • Network: Sockets
    • None
    • Linux/X11

    Description

      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.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes