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

[Windows] QLocalServer receives incorrect data when server and clients send data simultaneously

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.12.3
    • Network
    • None
    • Windows

    Description

      I'm using QLocalServer to make IPC between my apps. From client/server logic there is a valid message for both of them. In case of an incorrect message received - assertation happens. 

      For example (attached below), on every connection made, the server sends "server" string to the clients. When a client connects to the server - it sends "client" string. So, the server expects only "client" to be received and vice versa: 

      void Server::onReadRead() {
      // for example
      QString message;
      socketDataStream.setDevice(qobject_cast<QLocalSocket*>(sender())
      socketDataStream >> message;
      Q_ASSERT(message == "client");
      }
      

      In the attached example, the message sent after the socket connection.

      On Windows, this assertation triggered every time when the client connects. On Unix, no triggers, as for QTcpSocket will be used instead.

      Is this a bug form a named pine perspective or there is no possibility to read/write simultaneously when pipe used?

      The code from Qt should make this possible.

      Please check the attached example, run the server first.

       

      Attachments

        Issue Links

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

          Activity

            People

              manordheim Mårten Nordheim
              pavloshyba Pavlo Shyba
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes