Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.7.3, 6.8.1
-
None
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
Gerrit Reviews
For Gerrit Dashboard: QTBUG-132191 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
611783,4 | wasm: fix QTcpSocket error code when url doesn't exist | dev | qt/qtbase | Status: NEW | 0 | 0 |