2 QWebSockets implements the WebSocket protocol as defined in RFC 6455.
3 Copyright (C) 2013 Kurt Pattyn (pattyn.kurt@gmail.com)
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef DATAPROCESSOR_P_H
21 #define DATAPROCESSOR_P_H
27 // This file is not part of the Qt API. It exists purely as an
28 // implementation detail. This header file may change from version to
29 // version without notice, or even be removed.
38 #include "qwebsocketprotocol.h"
46 * @brief The DataProcessor class
48 class DataProcessor: public QObject
52 explicit DataProcessor(QObject *parent = 0);
53 virtual ~DataProcessor();
56 void controlFrameReceived(QWebSocketProtocol::OpCode opCode, QByteArray frame);
57 void textFrameReceived(QString frame, bool lastFrame);
58 void binaryFrameReceived(QByteArray frame, bool lastFrame);
59 void textMessageReceived(QString message);
60 void binaryMessageReceived(QByteArray message);
61 void errorEncountered(QWebSocketProtocol::CloseCode code, QString description);
64 void process(QTcpSocket *pSocket);
68 Q_DISABLE_COPY(DataProcessor)
72 PS_READ_PAYLOAD_LENGTH,
73 PS_READ_BIG_PAYLOAD_LENGTH,
81 QWebSocketProtocol::OpCode m_opCode;
82 bool m_isControlFrame;
85 QByteArray m_binaryMessage;
86 QString m_textMessage;
87 quint64 m_payloadLength;
88 QTextCodec::ConverterState *m_pConverterState;
89 QTextCodec *m_pTextCodec;
94 #endif // DATAPROCESSOR_P_H