From b019b9ccea08bcc7b65fd9f1a497546924ef592d Mon Sep 17 00:00:00 2001 From: Kurt Pattyn Date: Sat, 11 Jan 2014 19:08:28 +0100 Subject: 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 --- src/websockets/qwebsocket.cpp | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'src/websockets/qwebsocket.cpp') 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 @@ -550,44 +550,6 @@ QAbstractSocket::SocketState QWebSocket::state() const return d->state(); } -/*! - \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 */ -- cgit v1.2.1