48 QHttpSocketEngine(QObject *parent =
nullptr);
51 bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::IPv4Protocol) override;
52 bool initialize(qintptr socketDescriptor, QAbstractSocket::SocketState socketState = QAbstractSocket::ConnectedState) override;
54 void setProxy(
const QNetworkProxy &networkProxy);
56 qintptr socketDescriptor()
const override;
58 bool isValid()
const override;
60 bool connectInternal();
61 bool connectToHost(
const QHostAddress &address, quint16 port) override;
62 bool connectToHostByName(
const QString &name, quint16 port) override;
63 bool bind(
const QHostAddress &address, quint16 port) override;
64 bool listen(
int backlog) override;
65 qintptr accept() override;
66 void close() override;
68 qint64 bytesAvailable()
const override;
70 qint64 read(
char *data, qint64 maxlen) override;
71 qint64 write(
const char *data, qint64 len) override;
73#ifndef QT_NO_UDPSOCKET
74#ifndef QT_NO_NETWORKINTERFACE
75 bool joinMulticastGroup(
const QHostAddress &groupAddress,
76 const QNetworkInterface &interface) override;
77 bool leaveMulticastGroup(
const QHostAddress &groupAddress,
78 const QNetworkInterface &interface) override;
79 QNetworkInterface multicastInterface()
const override;
80 bool setMulticastInterface(
const QNetworkInterface &iface) override;
83 bool hasPendingDatagrams()
const override;
84 qint64 pendingDatagramSize()
const override;
87 qint64 readDatagram(
char *data, qint64 maxlen, QIpPacketHeader *,
88 PacketHeaderOptions) override;
89 qint64 writeDatagram(
const char *data, qint64 len,
const QIpPacketHeader &) override;
90 qint64 bytesToWrite()
const override;
92 int option(SocketOption option)
const override;
93 bool setOption(SocketOption option,
int value) override;
95 bool waitForRead(QDeadlineTimer deadline = QDeadlineTimer{DefaultTimeout},
96 bool *timedOut =
nullptr) override;
97 bool waitForWrite(QDeadlineTimer deadline = QDeadlineTimer{DefaultTimeout},
98 bool *timedOut =
nullptr) override;
99 bool waitForReadOrWrite(
bool *readyToRead,
bool *readyToWrite,
100 bool checkRead,
bool checkWrite,
101 QDeadlineTimer deadline = QDeadlineTimer{DefaultTimeout},
102 bool *timedOut =
nullptr) override;
104 void waitForProtocolHandshake(QDeadlineTimer deadline)
const;
106 bool isReadNotificationEnabled()
const override;
107 void setReadNotificationEnabled(
bool enable) override;
108 bool isWriteNotificationEnabled()
const override;
109 void setWriteNotificationEnabled(
bool enable) override;
110 bool isExceptionNotificationEnabled()
const override;
111 void setExceptionNotificationEnabled(
bool enable) override;
114 void slotSocketConnected();
115 void slotSocketDisconnected();
116 void slotSocketReadNotification();
117 void slotSocketBytesWritten();
118 void slotSocketError(QAbstractSocket::SocketError error);
119 void slotSocketStateChanged(QAbstractSocket::SocketState state);
122 void emitPendingReadNotification();
123 void emitPendingWriteNotification();
124 void emitPendingConnectionNotification();
127 void emitReadNotification();
128 void emitWriteNotification();
129 void emitConnectionNotification();
131 bool readHttpHeader();
133 Q_DECLARE_PRIVATE(QHttpSocketEngine)
134 Q_DISABLE_COPY_MOVE(QHttpSocketEngine)