Changed isValid() to only return true when the socket is also in connected
state. Also updated the documentation.
Change-Id: Id80dbc1f28c82bef19984c5ed7b34a7d474ee011
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
}
/*!
- Returns true if the QWebSocket is valid.
+ Returns \c true if the socket is ready for reading and writing; otherwise
+ returns \c false.
*/
bool QWebSocket::isValid() const
{
*/
bool QWebSocketPrivate::isValid() const
{
- return (m_pSocket && m_pSocket->isValid());
+ return (m_pSocket && m_pSocket->isValid() &&
+ (m_socketState == QAbstractSocket::ConnectedState));
}
QT_END_NAMESPACE