1

Can anybody give me a possible reason why my QSSLSocket would stop sending and receiving data without firing a stateChanged or disconnected signal.

My app starts a thread which connects to Facebooks XMPP server, authenticates and then goes into a while loop calling waitForReadyReady(10000) and then if this returns true it will read the data. Sometimes, After a while this call to waitForReadyReady will never return true even though there should be something to read and if I try to send data at this point the server won't receive anything.

I am sending pings to the XMPP server and can detect when this has happened after not receiving a reply to my ping but it's not really usable as an app until I get to the bottom of why communication is sometimes just breaking down between client and server.

Can anybody offer any insights please?

user1379811
  • 203
  • 2
  • 10
  • 1. Is the read buffer in the socket empty before you call waitForReadyRead()? Otherwise you might not have processed important data and waiting forever for new data. 2. Is the ping really sent? Check with wireshark 3. Do you see server pongs until a certain point? Are you sure the server didn't drop the connection silently for whatever reason? You might want to set up your own test server for debugging. – Frank Osterfeld Oct 23 '13 at 19:11
  • 1
    You might also consider using an XMPP library like e.g. Swiften http://swift.im/swiften/ if you don't do already. – Frank Osterfeld Oct 23 '13 at 19:13
  • I have spent days on this - it works perfectly on one device but not another. I have used wireshark today and the packets keep coming in but nothing is reported with waitForReadyReady(). test server seems a good idea - might look into this. – user1379811 Oct 23 '13 at 20:31
  • I have seen the problem still happening today after putting in a check for bytesAvailable > 0 before calling waitForReadyRead() and not waiting if there is something to read. Also, the outgoing and incoming communication breaks down at the same time. – user1379811 Oct 23 '13 at 20:36
  • I have spent the day redesigning the code to remove the use of a seperate thread and still the problem exists, I am using QXmpp and now using non blocking method and still no data comes or gets sent all of a sudden but wireshark shows data is being received and no signals are fired. anybody please? – user1379811 Oct 24 '13 at 20:18
  • So it's unreliable on a specific machine but works fully reliable on another? Same OS etc., or different? – Frank Osterfeld Oct 24 '13 at 20:55
  • Its all Blackberry 10, I have a dev alpha device which is just running 10.2 full leaked os and this doesn't ever have this problem, and then the Z10, this has this problem when running 10.1 and 10.2 device os and when trying 10.0.1, 10.1 and 10.2, basically tried updating sdk and device os to see if that was the problem but it isn't. I have made some debug output statements in the qxmpp files (started afresh with QXmpp today) and the readyready slot just stops being called for some reason but the disconnection slot is called when the timeout timer closes the connection due to no reply. – user1379811 Oct 24 '13 at 21:22

0 Answers0