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

QLocalServer and QLocalSocket use different types for socketDescriptor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 6.2.3
    • Fix Version/s: None
    • Component/s: Network: Sockets
    • Labels:
      None

      Description

      QAbstractSocket, QLocalSocket and QLocalServer all use the qintptr type for the native socket descriptor:

      qintptr QLocalServer::socketDescriptor() const
      bool QLocalSocket::setSocketDescriptor(qintptr socketDescriptor, QLocalSocket::LocalSocketState socketState = ConnectedState, QIODevice::OpenMode openMode = ReadWrite)

      Yet QLocalServer uses quintptr for the incomingConnection method, and only incomingConnection:

       

      virtual void QLocalServer::incomingConnection(quintptr socketDescriptor)

       

      I believe this is an API bug as it forces us to cast the socketDescriptor in order to use it with the associated QLocalSocket class.

      While we'd obviously need to cast it to use it with 'native' OS functions, it feels very wrong that we also need to cast it when using pure Qt.

        Attachments

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

          Activity

            People

            Assignee:
            manordheim Mårten Nordheim
            Reporter:
            rthompson Richard Thompson
            PM Owner:
            Vladimir Minenko Vladimir Minenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes