We already had a keep-alive mechanism which did send pings periodically around every 3 seconds. This did not help.
No, the app is not backgrounded. I am using idleTimerDisabled to prevent the backgrounding. Also i tried to transfer while touching the UI every minute so it won't go to background. The app did not go to the background, but still the connection got disconnected with the error "Timeout when reading data from socket.". I did not yet try Android, since the software has some OS specific parts which are only implemented for iOS and Windows. I will try this with a minimalized version. 2017-01-20 18:33 GMT+01:00 Jason H <jh...@gmx.com>: > What about sending sending ping messages periodically? > > Is your app being backgrounded? I had a problem with websockets disconnecting > on iOS, but not on Android. > >> Sent: Friday, January 20, 2017 at 5:58 AM >> From: "Markus Steinhilber" <markus.st....@gmail.com> >> To: interest@qt-project.org >> Subject: [Interest] Problem transfering bigger data amounts over Websockets >> on iOS >> >> Hi, >> >> I currently have a problem with websockets on iOS. I'm using a >> websocket connection to send commands and files over a network (WiFi) >> between 2 devices. The server is a Windows CE device with Qt5.3 and >> the client can be an iPad or Windows PC, using a program compiled with >> Qt 5.7.1. The files are transfered by breaking them into smaller parts >> (~20-300KB, depending on the speed of the last part) and sending them >> as a websocket message. There is a small protocol implemented to >> coordinate the parts. >> >> Especially when transfering bigger files(>200MB) over the network, at >> some point i always run into a disconnect of the socket with the >> closeReason "Timeout when reading data from socket." on the Client. >> The server then gives a normal disconnect without closeReason. >> >> My first question is: Is this a normal closeReason for a disconnect in >> case of a bad WiFi connection or could it be a bug in my software or >> even in Qt's Websocket implementation? I did force some disconnects by >> powering off the server device while transfering data and I did not >> get the same error on the client. >> >> I also found the QTBUG-14975 which very much sounds like my issue. The >> closeReason is set in qwebsocketframe.cpp after a >> waitForReadyRead(5000). But the main differences are that this bug is >> only reported as happening on Windows and about every 4-5GB >> transmitted. In my case it's happening only on iOS and about every >> 200-300 MB. >> >> Since the problem only happens on iOS(iPad and simulator) but not with >> a Windows PC as client, i am also thinking about, if this could be an >> OS related problem. Like iOS detecting a Wifi disconnect earlier when >> a Windows PC maybe waits a bit longer and the connections get better >> again. >> >> Would it be a solution to change the timeout of the >> waitForReadyRead(5000) in qwebsocketframe.cpp and compile a custom Qt? >> Is it likely that this will help? >> >> Thanks for any help on that topic. I'm investigating this problem for >> days and don't find any solution. >> _______________________________________________ >> Interest mailing list >> Interest@qt-project.org >> http://lists.qt-project.org/mailman/listinfo/interest >> _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest