From 737349ab405396acc1b6568bcde73b680ff98705 Mon Sep 17 00:00:00 2001 From: Ernesto De Stefano Date: Thu, 16 Feb 2017 15:58:51 +0100 Subject: [PATCH] waitForBytesWritten optionally waitForBytesWritten is not execute when writeTimeout is less than -1. --- src/qamqpframe.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qamqpframe.cpp b/src/qamqpframe.cpp index b7c9ae2..2c4bf10 100644 --- a/src/qamqpframe.cpp +++ b/src/qamqpframe.cpp @@ -73,6 +73,13 @@ QDataStream &operator<<(QDataStream &stream, const QAmqpFrame &frame) // write end stream << qint8(QAmqpFrame::FRAME_END); + + int writeTimeout = QAmqpFrame::writeTimeout(); + if(writeTimeout >= -1) + { + stream.device()->waitForBytesWritten(writeTimeout); + } + return stream; }