\section1 Examples
- The module provides the following examples as a guide to using
+ The module provides the \l{Qt WebSockets Examples}{Examples} as a guide to using
the API.
- \l{Qt WebSockets Examples}{Examples}
*/
\brief The QMaskGenerator class provides an abstract base for custom 32-bit mask generators.
- The WebSockets specification as outlined in {http://tools.ietf.org/html/rfc6455}{RFC 6455}
- requires that all communication from client to server must be masked. This is to prevent
- malicious scripts to attack bad behaving proxies.
+ The WebSockets specification as outlined in \l {http://tools.ietf.org/html/rfc6455}{RFC 6455}
+ requires that all communication from client to server be masked. This is to prevent
+ malicious scripts from attacking badly behaving proxies.
For more information about the importance of good masking,
see \l {http://w2spconf.com/2011/papers/websocket.pdf}.
By default QWebSocket uses the cryptographically insecure qrand() function.
This signal is emitted whenever QWebSocket's state changes.
The \a state parameter is the new state.
- \note QAbstractSocket::ConnectedState is emitted after the handshake has
+ \note QAbstractSocket::ConnectedState is emitted after the handshake
with the server has succeeded.
QAbstractSocket::SocketState is not a registered metatype, so for queued
\note This signal has the same meaning both for secure and non-secure websockets.
As opposed to QSslSocket, bytesWritten() is only emitted when encrypted data is effectively
- written (see QSslSocket:encryptedBytesWritten()).
+ written (see QSslSocket::encryptedBytesWritten()).
\sa close()
*/
* \brief Creates a new QWebSocket with the given \a origin,
* the \a version of the protocol to use and \a parent.
*
- * The \a origin of the client is as specified \l {http://tools.ietf.org/html/rfc6454}{RFC 6454}.
+ * The \a origin of the client is as specified in \l {http://tools.ietf.org/html/rfc6454}{RFC 6454}.
* (The \a origin is not required for non-web browser clients
* (see \l {http://tools.ietf.org/html/rfc6455}{RFC 6455})).
* The \a origin may not contain new line characters, otherwise the connection will be
#endif //not QT_NO_SSL
/*!
- \brief Returns the version the socket is currently using
+ \brief Returns the version the socket is currently using.
*/
QWebSocketProtocol::Version QWebSocket::version() const
{
}
/*!
- \brief Returns the current origin
+ \brief Returns the current origin.
*/
QString QWebSocket::origin() const
{
}
/*!
- \brief Returns the current state of the socket
+ \brief Returns the current state of the socket.
*/
QAbstractSocket::SocketState QWebSocket::state() const
{
Exceptionally, a buffer size of 0 means that the read buffer is unlimited and
all incoming data is buffered. This is the default.
This option is useful if you only read the data at certain points in time
- (e.g., in a real-time streaming application) or if you want to protect your socket against
+ (for example, in a real-time streaming application) or if you want to protect your socket against
receiving too much data, which may eventually cause your application to run out of memory.
\sa readBufferSize()
It provides applications with fine-grained control over which origin URLs are allowed
and which aren't.
By default, every origin is accepted.
- To get fine grained control, an application connects the
+ To get fine-grained control, an application connects the
\l{QWebSocketServer::}{originAuthenticationRequired()} signal to a slot.
When the origin (QWebSocketCorsAuthenticator::origin()) is accepted,
it calls QWebSocketCorsAuthenticator::setAllowed(true)
}
/*!
- Destroys the object
+ Destroys the object.
*/
QWebSocketCorsAuthenticator::~QWebSocketCorsAuthenticator()
{
}
/*!
- Constructs a copy of \a other
+ Constructs a copy of \a other.
*/
QWebSocketCorsAuthenticator::QWebSocketCorsAuthenticator(const QWebSocketCorsAuthenticator &other) :
d_ptr(new QWebSocketCorsAuthenticatorPrivate(other.d_ptr->m_origin, other.d_ptr->m_isAllowed))
}
/*!
- Assigns \a other to this authenticator object
+ Assigns \a other to this authenticator object.
*/
QWebSocketCorsAuthenticator &
QWebSocketCorsAuthenticator::operator =(const QWebSocketCorsAuthenticator &other)
QWebSocketServer only supports version 13 of the WebSocket protocol, as outlined in RFC 6455.
- \sa echoserver.html
-
- \sa QWebSocket
+ \sa {WebSocket Server Example}, QWebSocket
*/
/*!
/*!
\fn void QWebSocketServer::acceptError(QAbstractSocket::SocketError socketError)
- This signal is emitted when accepting a new connection results in an error.
- The \a socketError parameter describes the type of error that occurred
+ This signal is emitted when the acceptance of a new connection results in an error.
+ The \a socketError parameter describes the type of error that occurred.
\sa pauseAccepting(), resumeAccepting()
*/
/*!
\fn void QWebSocketServer::closed()
- This signal is emitted when the server closed it's connection.
+ This signal is emitted when the server closed its connection.
\sa close()
*/
This signal is emitted when a new connection is requested.
The slot connected to this signal should indicate whether the origin
(which can be determined by the origin() call) is allowed in the \a authenticator object
- (by issuing \l{QWebSocketCorsAuthenticator::}{setAllowed()})
+ (by issuing \l{QWebSocketCorsAuthenticator::}{setAllowed()}).
If no slot is connected to this signal, all origins will be accepted by default.
usually an indication that QWebSocketServer is unable to securely identify the
peer.
- This signal provides you with an early indication when something's wrong.
+ This signal provides you with an early indication when something is wrong.
By connecting to this signal, you can manually choose to tear down the
connection from inside the connected slot before the handshake has
completed. If no action is taken, QWebSocketServer will proceed to emitting
/*!
Constructs a new QWebSocketServer with the given \a serverName.
- The \a serverName will be used in the http handshake phase to identify the server.
+ The \a serverName will be used in the HTTP handshake phase to identify the server.
It can be empty, in which case an empty server name will be sent to the client.
The \a secureMode parameter indicates whether the server operates over wss (\l{SecureMode})
or over ws (\l{NonSecureMode}).
/*!
Returns the next pending connection as a connected QWebSocket object.
QWebSocketServer does not take ownership of the returned QWebSocket object.
- It is up to the caller to delete the object explicitly when it is done using it,
+ It is up to the caller to delete the object explicitly when it will no longer be used,
otherwise a memory leak will occur.
Q_NULLPTR is returned if this function is called when there are no pending connections.
}
/*!
- Sets the server name that will be used during the http handshake phase to the given
+ Sets the server name that will be used during the HTTP handshake phase to the given
\a serverName.
The \a serverName can be empty, in which case an empty server name will be sent to the client.
Existing connected clients will not be notified of this change, only newly connecting clients