Hi,

When I use a QTcpSocket in a desktop Qt 5 app built and run on osx I seem to have a problem which makes my new app unusable if I can't fix it.

My Qt app creates a socket connection to my server app on an Android device and this all works as it should but then when I want to write data to the socket sometimes (mostly sends instantly) Qt won't send it straight away but the delay is sometimes minutes, sometimes it's been nearly 5 minutes before the server receives the data on the already opened socket.

I have spent a couple of days researching and nowhere do I find this kind of delay to be something we have to put up with if using TCP (I have read about and disabled Nagle algorithm).

When the problem occurs I don't see the data in Wireshark when I send it (triggered from a button press on my Qt app) for the minutes until it arrives on my android device so that's make me sure it's related to my Qt side.

I am sending very small strings when I write to the socket which are less than 20 characters long are always terminated with "\n".

I have tried using waitForBytesWritten() and various socket options such as the ones below with no success in making my QTcpSocket send the data I write to it within a few seconds, can anyone explain why the data would just be sat somewhere for minutes before being sent sometimes?

socket->setSocketOption(QAbstractSocket::SendBufferSizeSo cketOption,5);
socket->setSocketOption(QAbstractSocket::LowDelayOption,1 );
socket->setSocketOption(QAbstractSocket::KeepAliveOption, 1);

Thank you.