Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qabstractsocket_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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
4#ifndef QABSTRACTSOCKET_P_H
5#define QABSTRACTSOCKET_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of the QAbstractSocket class. This header file may change from
13// version to version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtNetwork/private/qtnetworkglobal_p.h>
19#include "QtNetwork/qabstractsocket.h"
20#include "QtCore/qbytearray.h"
21#include "QtCore/qlist.h"
22#include "QtCore/qtimer.h"
23#include "private/qiodevice_p.h"
24#include "private/qabstractsocketengine_p.h"
25#include "qnetworkproxy.h"
26
28
29class QHostInfo;
30
32{
33 Q_DECLARE_PUBLIC(QAbstractSocket)
34public:
37
38 // from QAbstractSocketEngineReceiver
39 inline void readNotification() override { canReadNotification(); }
40 inline void writeNotification() override { canWriteNotification(); }
41 inline void exceptionNotification() override {}
42 inline void closeNotification() override { canCloseNotification(); }
43 void connectionNotification() override;
44#ifndef QT_NO_NETWORKPROXY
45 inline void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator) override {
46 Q_Q(QAbstractSocket);
47 emit q->proxyAuthenticationRequired(proxy, authenticator);
48 }
49#endif
50
51 virtual bool bind(const QHostAddress &address, quint16 port, QAbstractSocket::BindMode mode);
52
53 virtual bool canReadNotification();
56
57 // slots
59 void _q_startConnecting(const QHostInfo &hostInfo);
60 void _q_testConnection();
62
63 bool emittedReadyRead = false;
64 bool emittedBytesWritten = false;
65
66 bool abortCalled = false;
67 bool pendingClose = false;
68
69 QAbstractSocket::PauseModes pauseMode = QAbstractSocket::PauseNever;
70
74 QList<QHostAddress> addresses;
75
81
84
85#ifndef QT_NO_NETWORKPROXY
90#else
91 inline void resolveProxy(const QString &, quint16) { }
92#endif
94
95 void resetSocketLayer();
96 virtual bool flush();
97
99 virtual void configureCreatedSocket();
102 bool readFromSocket();
103 virtual bool writeToSocket();
104 void emitReadyRead(int channel = 0);
105 void emitBytesWritten(qint64 bytes, int channel = 0);
106
109
111 bool isBuffered = false;
112 bool hasPendingData = false;
113 bool hasPendingDatagram = false;
114
116
117 int hostLookupId = -1;
118
121
122 // Must be kept in sync with QIODevicePrivate::errorString.
124
127
134};
135
137
138#endif // QABSTRACTSOCKET_P_H
IOBluetoothL2CAPChannel * channel
QList< QHostAddress > addresses
void setError(QAbstractSocket::SocketError errorCode, const QString &errorString)
void resolveProxy(quint16 port)
void emitBytesWritten(qint64 bytes, int channel=0)
QAbstractSocket::NetworkLayerProtocol preferredNetworkLayerProtocol
void emitReadyRead(int channel=0)
QAbstractSocket::SocketError socketError
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator) override
QAbstractSocket::SocketType socketType
static QAbstractSocketEngine * getSocketEngine(QAbstractSocket *)
void _q_startConnecting(const QHostInfo &hostInfo)
QAbstractSocketEngine * socketEngine
void startConnectingByName(const QString &host)
virtual bool canReadNotification()
void resolveProxy(const QString &hostName, quint16 port)
void closeNotification() override
void readNotification() override
virtual void configureCreatedSocket()
void exceptionNotification() override
bool initSocketLayer(QAbstractSocket::NetworkLayerProtocol protocol)
static void pauseSocketNotifiers(QAbstractSocket *)
virtual bool bind(const QHostAddress &address, quint16 port, QAbstractSocket::BindMode mode)
QAbstractSocket::SocketState state
static void resumeSocketNotifiers(QAbstractSocket *)
void connectionNotification() override
void setErrorAndEmit(QAbstractSocket::SocketError errorCode, const QString &errorString)
QAbstractSocket::PauseModes pauseMode
void writeNotification() override
The QAbstractSocket class provides the base functionality common to all socket types.
SocketState
This enum describes the different states in which a socket can be.
static constexpr auto UnknownNetworkLayerProtocol
SocketError
This enum describes the socket errors that can occur.
SocketType
This enum describes the transport layer protocol.
The QAuthenticator class provides an authentication object.
The QHostAddress class provides an IP address.
The QHostInfo class provides static functions for host name lookups.
Definition qhostinfo.h:19
The QNetworkProxy class provides a network layer proxy.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qtimer.h:20
Combined button and popup list for selecting options.
EGLOutputPortEXT port
GLenum mode
GLuint GLuint64EXT address
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
#define emit
unsigned short quint16
Definition qtypes.h:48
long long qint64
Definition qtypes.h:60
ptrdiff_t qintptr
Definition qtypes.h:166