-
Bug
-
Resolution: Won't Do
-
P2: Important
-
None
-
5.9.1, 5.11.0
-
None
-
Windows 10 + Qt 5.9.1 for UWP 64bit (MSVC 2017)
Windows 10 + Qt 5.9.1 for UWP 32bit (MSVC 2017)
Testcase:
import QtQuick 2.0 import QtWebSockets 1.0 Item { width: 360 height: 360 anchors.fill: parent WebSocket { id: socket url: "ws://echo.websocket.org" active: true onTextMessageReceived: messageBox.text = messageBox.text + "\nReceived message: " + (message.length < 10 ? message : message.length) onStatusChanged: if (socket.status == WebSocket.Error) { messageBox.text += "\nError: " + socket.errorString } else if (socket.status == WebSocket.Open) { messageBox.text += "\nSocket Opened" } else if (socket.status == WebSocket.Closed) { messageBox.text += "\nSocket closed" } } Timer { running: socket.status === WebSocket.Open interval: 1000 repeat: true onTriggered: { socket.sendTextMessage('One') socket.sendTextMessage(new Array(7000).join('x')) socket.sendTextMessage('Two') socket.sendTextMessage(new Array(7000).join('x')) } } Text { id: messageBox anchors { bottom: parent.bottom; left: parent.left; right: parent.right } } }
The connection gets lost after 2-10 messages, with «Unknown error» in QML and «QIODevice::write (QTcpSocket): device not open» in console.
The same could be reproduced with other servers, e.g. in my case I was sending only short messages from QML and receiving ~5000 chars messages, and the connection got aborted after 1-3 incoming messages.
This is perfectly reproduceable, it loses the connection every time after just a few messages.