summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocket.cpp
diff options
context:
space:
mode:
authorKurt Pattyn <pattyn.kurt@gmail.com>2013-11-17 15:30:34 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-17 15:31:11 +0100
commitb68dcd71d3b73a8d6be57a0001af2d79bce98533 (patch)
treedf11355e2a9de126d8123e4cfb9888eb2f0dc076 /src/websockets/qwebsocket.cpp
parentd5cc962781407e8a8f6560d5579128ac24c96231 (diff)
downloadqtwebsockets-b68dcd71d3b73a8d6be57a0001af2d79bce98533.tar.gz
Add close code and close reason getter functions
Change-Id: I4eeab1521054e4f4921d25c6a990eeb7486443cb Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Diffstat (limited to 'src/websockets/qwebsocket.cpp')
-rw-r--r--src/websockets/qwebsocket.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/websockets/qwebsocket.cpp b/src/websockets/qwebsocket.cpp
index 21b6a35..0d3b23d 100644
--- a/src/websockets/qwebsocket.cpp
+++ b/src/websockets/qwebsocket.cpp
@@ -509,6 +509,26 @@ QString QWebSocket::extension() const
}
/*!
+ \brief Returns the code indicating why the socket was closed.
+ \sa QWebSocketProtocol::CloseCode, closeReason()
+ */
+QWebSocketProtocol::CloseCode QWebSocket::closeCode() const
+{
+ Q_D(const QWebSocket);
+ return d->closeCode();
+}
+
+/*!
+ \brief Returns the reason why the socket was closed.
+ \sa closeCode()
+ */
+QString QWebSocket::closeReason() const
+{
+ Q_D(const QWebSocket);
+ return d->closeReason();
+}
+
+/*!
\brief Returns the current state of the socket
*/
QAbstractSocket::SocketState QWebSocket::state() const