avoid closing local sockets before writing is finished

This commit is contained in:
Luis Ángel San Martín
2014-06-19 20:35:28 +02:00
parent 9ce0da721e
commit b0b1a5e98c
2 changed files with 7 additions and 1 deletions

View File

@ -110,7 +110,7 @@ void YACReaderClientConnectionWorker::run()
}
if(tries == 20)
{
QLOG_ERROR() << "Local connection: unable to read the message size";
QLOG_ERROR() << "Local connection: unable to read the message size" << clientConnection->errorString();
return;
}
@ -163,6 +163,7 @@ void YACReaderClientConnectionWorker::run()
while(written != block.size() && tries < 200)
{
int ret = clientConnection->write(block);
clientConnection->waitForBytesWritten(10);
if(ret != -1)
{
written += ret;