Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.7.0
-
None
-
-
9b01f1bdb (dev), b56e959d6 (6.8)
Description
It appears that QTcpSocket may not emit the readyRead signal on the WebAssembly target in the following circumstance:
- Client running on WebAssembly creates a QTcpSocket and connects to a server QWebSocketServer running on x64.
- The server, on the QWebSocketServer::newConnection signal, immediately sends a binary or text message to the client that is less than around 3700 bytes. (Exact size appears to depend on socket name).
- Client will get QTcpSocket::connected signal, but appears not to get readyRead signal, unless server transmits more data (which for the protocol I'm working on, never happens, as server is waiting for a response from client).
Some observations:
- If the server transmits a bit more data (such that the first packet of data transmitted is bigger than 4096 bytes), then the readyRead signal is emitted.
- If the server has a bit of a time delay after newConnection before it sends the small amount of data, then readyRead is emitted.
- In the case that readyRead is not emitted, the data is definitely received by the client. handleMessage in library_sockfs.js is called and QEventDispatcherWasm::socketMessage is called.
It appears as though there may be a race condition. It seems in the failing case, when QEventDispatcherWasm::socketMessage is called, the notifier hasn't been set up yet.. i.e. QEventDispatcherWasm::registerSocketNotifier hasn't yet been called. In the working cases, registerSocketNotifier is called before socketMessage.
Attachments
For Gerrit Dashboard: QTBUG-125874 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
569065,10 | wasm: fix wasm sockets when data buffer is less than 3696 | dev | qt/qtbase | Status: MERGED | +2 | 0 |
599264,2 | wasm: fix wasm sockets when data buffer is less than 3696 | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |