diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2018-04-10 15:04:10 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2018-04-14 21:42:11 +0000 |
commit | bd100e777190f68c4da11d4f7a1c4bf8274211d9 (patch) | |
tree | f6c68bcab73988658a3abac8a6dcf0c2a81911a8 /src/websockets/qwebsocket.h | |
parent | 4f0346907cd1e3c6e37dd0eb7ef99434a0e21587 (diff) | |
download | qtwebsockets-bd100e777190f68c4da11d4f7a1c4bf8274211d9.tar.gz |
QWebSocket: Add 'bytesToWrite'
Add the well-known 'bytesToWrite' function to QWebSocket. Previously
the only way to know how many bytes were left to be written was to
make a guesstimate on the overhead your message would get and then
keep track of the amount sent using the 'bytesWritten' signal.
The tests compare using '>' because there is overhead from the headers.
[ChangeLog][QWebSocket] Added the bytesToWrite function to
QWebSocket. Call this function to see how many bytes are left to write.
Change-Id: I82f17a98b582ee3bc02f0c47597b4a6717761f12
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/websockets/qwebsocket.h')
-rw-r--r-- | src/websockets/qwebsocket.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/websockets/qwebsocket.h b/src/websockets/qwebsocket.h index a80c47a..b8742e8 100644 --- a/src/websockets/qwebsocket.h +++ b/src/websockets/qwebsocket.h @@ -113,6 +113,8 @@ public: QSslConfiguration sslConfiguration() const; #endif + qint64 bytesToWrite() const; + public Q_SLOTS: void close(QWebSocketProtocol::CloseCode closeCode = QWebSocketProtocol::CloseCodeNormal, const QString &reason = QString()); |