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

wasm: QTcpSocket signals connected rather errorOccurred

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.3, 6.8.1
    • Network: Sockets
    • None
    • WebAssembly

    Description

      On WebAssembly platform, QTcpSocket::connectToHost always appears to signal connected() with state() == QAbstractSocket::ConnectedState, even if the connection fails (such as when there's no server to respond). This is when linking with  -sWEBSOCKET_URL=wss:// 
       
      In the browser console (Edge, Chrome and Firefox on Windows), the Emscripten socket code indicates an error has occured. E.g: 
       
           WASMSocketBug.js:4242 WebSocket connection to 'wss://127.0.0.1:34561/' failed:
      but Qt code seems to signal connected() rather than errorOccurred().

      Simple test case attached that tries to connect to non existent server. On Windows Qt, errorOccurred() is called with "Connection refused". On WebAssembly, connected() is called.

       

       

      Attachments

        For Gerrit Dashboard: QTBUG-132191
        # Subject Branch Project Status CR V

        Activity

          People

            lopotter-ext Lorn Potter
            srcejon Jon Beniston
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change