diff options
author | Kurt Pattyn <pattyn.kurt@gmail.com> | 2014-01-11 19:08:28 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-11 19:11:17 +0100 |
commit | b019b9ccea08bcc7b65fd9f1a497546924ef592d (patch) | |
tree | 58b2bb768b956ba931d5e60a5e5f6febdd366919 /src/websockets/qwebsocket.cpp | |
parent | a3f715c477a86b164c7db7a1740ac2ac3b21dbc7 (diff) | |
download | qtwebsockets-b019b9ccea08bcc7b65fd9f1a497546924ef592d.tar.gz |
Remove waitXXX() methods from websockets
The QWebSocketServer::waitForNewConnection() was just calling
QTcpServer::waitForNewConnection(), which was not correct because
a connection is only complete when the handshake succeeds.
Waiting for the handshake to complete would need a separate thread
for the handshake handling code, which would complicate the code a lot.
It was decided to leave out all waitXXX() methods from the module,
as it is easier to add this functionality later, then to remove it.
Change-Id: I778bae45b67f81e151ad2362f772c75e9f537ff0
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Diffstat (limited to 'src/websockets/qwebsocket.cpp')
-rw-r--r-- | src/websockets/qwebsocket.cpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/websockets/qwebsocket.cpp b/src/websockets/qwebsocket.cpp index 943af56..2887b84 100644 --- a/src/websockets/qwebsocket.cpp +++ b/src/websockets/qwebsocket.cpp @@ -551,44 +551,6 @@ QAbstractSocket::SocketState QWebSocket::state() const } /*! - \brief Waits until the socket is connected, up to \a msecs milliseconds. If the connection has been established, this function returns true; otherwise it returns false. In the case where it returns false, you can call error() to determine the cause of the error. - The following example waits up to one second for a connection to be established: - - \code - socket->open("ws://localhost:1234", false); - if (socket->waitForConnected(1000)) - { - qDebug("Connected!"); - } - \endcode - - If \a msecs is -1, this function will not time out. - \note This function may wait slightly longer than msecs, depending on the time it takes to complete the host lookup. - \note Multiple calls to this functions do not accumulate the time. If the function times out, the connecting process will be aborted. - - \sa connected(), open(), state() - */ -bool QWebSocket::waitForConnected(int msecs) -{ - Q_D(QWebSocket); - return d->waitForConnected(msecs); -} - -/*! - Waits \a msecs for the socket to be disconnected. - If the socket was successfully disconnected within time, this method returns true. - Otherwise false is returned. - When \a msecs is -1, this function will block until the socket is disconnected. - - \sa close(), state() -*/ -bool QWebSocket::waitForDisconnected(int msecs) -{ - Q_D(QWebSocket); - return d->waitForDisconnected(msecs); -} - -/*! Returns the local address */ QHostAddress QWebSocket::localAddress() const |