Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qpacketprotocol_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant
4
5#ifndef QPACKETPROTOCOL_P_H
6#define QPACKETPROTOCOL_P_H
7
8#include <QtCore/qobject.h>
9
10//
11// W A R N I N G
12// -------------
13//
14// This file is not part of the Qt API. It exists purely as an
15// implementation detail. This header file may change from version to
16// version without notice, or even be removed.
17//
18// We mean it.
19//
20
21QT_BEGIN_NAMESPACE
22
23class QIODevice;
24
27{
28 Q_OBJECT
29 Q_DECLARE_PRIVATE(QPacketProtocol)
30public:
31 explicit QPacketProtocol(QIODevice *dev, QObject *parent = nullptr);
32
33 void send(const QByteArray &data);
36 bool waitForReadyRead(int msecs = 3000);
37
39 void readyRead();
40 void error();
41
42private:
43 void bytesWritten(qint64 bytes);
44 void readyToRead();
45};
46
47QT_END_NAMESPACE
48
49#endif // QPACKETPROTOCOL_P_H
ImageReaderError error() const
Returns the type of error that occurred last.
QList< QByteArray > packets
bool writeToDevice(const char *bytes, qint64 size)
QList< qint32 > sendingPackets
bool readFromDevice(char *buffer, qint64 size)
The QPacketProtocol class encapsulates communicating discrete packets across fragmented IO channels,...
void send(const QByteArray &data)
Transmit the packet.
bool waitForReadyRead(int msecs=3000)
This function locks until a new packet is available for reading and the \l{QIODevice::}...
qint64 packetsAvailable() const
Returns the number of received packets yet to be read.
QByteArray read()
Return the next unread packet, or an empty QByteArray if no packets are available.
Combined button and popup list for selecting options.