Update documentation
authorKurt Pattyn <pattyn.kurt@gmail.com>
Sat, 25 Jan 2014 13:48:20 +0000 (14:48 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sat, 1 Feb 2014 14:36:18 +0000 (15:36 +0100)
Clarified which versions are supported and that subprotocols
and extensions are not supported. Fixed some typos.

Change-Id: I99ef2fbbf74c287bea7d1b7a07881bf0542135ff
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
src/websockets/qwebsocket.cpp
src/websockets/qwebsocketframe.cpp
src/websockets/qwebsocketprotocol.cpp
src/websockets/qwebsocketserver.cpp

index 40b9da1..17bd364 100644 (file)
 
     This class was modeled after QAbstractSocket.
 
+    QWebSocket currently does not support
+    \l {http://tools.ietf.org/html/rfc6455#page-39} {extensions} and
+    \l {http://tools.ietf.org/html/rfc6455#page-12} {subprotocols}.
+
+    QWebSocket only supports version 13 of the WebSocket protocol, as outlined in RFC 6455.
+
     \sa QAbstractSocket, QTcpSocket
 
     \sa {QWebSocket client example}
index f5a4787..1f6e3da 100644 (file)
@@ -51,7 +51,7 @@
     It processes frames one at a time.
     \note It is the QWebSocketDataProcessor that takes the sequence into account.
 
-    \sa DataProcessor()
+    \sa QWebSocketDataProcessor
     \internal
  */
 
index efcc313..01178ad 100644 (file)
@@ -71,7 +71,7 @@ QT_BEGIN_NAMESPACE
     \value CloseCodeTooMuchData             Message too big
     \value CloseCodeMissingExtension        Mandatory extension missing
     \value CloseCodeBadOperation            Internal server error
-    \value CloseCodeHandshakeFailed         TLS handshake failed
+    \value CloseCodeTlsHandshakeFailed      TLS handshake failed
 
     \sa QWebSocket::close()
 */
@@ -85,37 +85,44 @@ QT_BEGIN_NAMESPACE
     For an overview of the differences between the different protocols, see
     <http://code.google.com/p/pywebsocket/wiki/WebSocketProtocolSpec>
 
-    \value VersionUnknow    Unknown or unspecified version.
+    \value VersionUnknown   Unknown or unspecified version.
     \value Version0         hixie76:
                             http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76 &
                             hybi-00:
                             http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00.
                             Works with key1, key2 and a key in the payload.
                             Attribute: Sec-WebSocket-Draft value 0.
+                            Not supported by QtWebSockets.
     \value Version4         hybi-04:
                             http://tools.ietf.org/id/draft-ietf-hybi-thewebsocketprotocol-04.txt.
                             Changed handshake: key1, key2, key3
                             ==> Sec-WebSocket-Key, Sec-WebSocket-Nonce, Sec-WebSocket-Accept
                             Sec-WebSocket-Draft renamed to Sec-WebSocket-Version
                             Sec-WebSocket-Version = 4.
+                            Not supported by QtWebSockets.
     \value Version5         hybi-05:
                             http://tools.ietf.org/id/draft-ietf-hybi-thewebsocketprotocol-05.txt.
                             Sec-WebSocket-Version = 5
                             Removed Sec-WebSocket-Nonce
                             Added Sec-WebSocket-Accept.
+                            Not supported by QtWebSockets.
     \value Version6         Sec-WebSocket-Version = 6.
+                            Not supported by QtWebSockets.
     \value Version7         hybi-07:
                             http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07.
                             Sec-WebSocket-Version = 7.
+                            Not supported by QtWebSockets.
     \value Version8         hybi-8, hybi-9, hybi-10, hybi-11 and hybi-12.
                             Status codes 1005 and 1006 are added and all codes are now unsigned
                             Internal error results in 1006.
+                            Not supported by QtWebSockets.
     \value Version13        hybi-13, hybi14, hybi-15, hybi-16, hybi-17 and RFC 6455.
                             Sec-WebSocket-Version = 13
                             Status code 1004 is now reserved
                             Added 1008, 1009 and 1010
                             Must support TLS
-                            Clarify multiple version suppor.t
+                            Clarify multiple version support.
+                            Supported by QtWebSockets.
     \value VersionLatest    Refers to the latest known version to QtWebSockets.
 */
 
index e52a539..30ff88d 100644 (file)
     Call nextPendingConnection() to accept the pending connection as a connected QWebSocket.
     The function returns a pointer to a QWebSocket in QAbstractSocket::ConnectedState that you can
     use for communicating with the client.
+
     If an error occurs, serverError() returns the type of error, and errorString() can be called
     to get a human readable description of what happened.
+
     When listening for connections, the address and port on which the server is listening are
     available as serverAddress() and serverPort().
+
     Calling close() makes QWebSocketServer stop listening for incoming connections.
 
+    QWebSocketServer currently does not support
+    \l {http://tools.ietf.org/html/rfc6455#page-39} {extensions} and
+    \l {http://tools.ietf.org/html/rfc6455#page-12} {subprotocols}.
+
+    QWebSocketServer only supports version 13 of the WebSocket protocol, as outlined in RFC 6455.
+
     \sa echoserver.html
 
     \sa QWebSocket
 
   \snippet echoserver/echoserver.cpp processTextMessage
   Whenever `processTextMessage()` is triggered, we retrieve the sender, and if valid, send back the
-  original message (`send()`).
+  original message (`sendTextMessage()`).
   The same is done with binary messages.
   \snippet echoserver/echoserver.cpp processBinaryMessage
   The only difference is that the message now is a QByteArray instead of a QString.
 QT_BEGIN_NAMESPACE
 
 /*!
-    Constructs a new WebSocketServer with the given \a serverName.
+    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 secureMode parameter indicates whether the server operates over wss (\l{SecureMode})
     or over ws (\l{NonSecureMode}).