34 public QAbstractSocketEngineReceiver
36 Q_DECLARE_PUBLIC(QAbstractSocket)
38 QAbstractSocketPrivate(
decltype(QObjectPrivateVersion) version = QObjectPrivateVersion);
39 virtual ~QAbstractSocketPrivate();
42 inline void readNotification() override { canReadNotification(); }
43 inline void writeNotification() override { canWriteNotification(); }
44 inline void exceptionNotification() override {}
45 inline void closeNotification() override { canCloseNotification(); }
46 void connectionNotification() override;
47#ifndef QT_NO_NETWORKPROXY
48 inline void proxyAuthenticationRequired(
const QNetworkProxy &proxy, QAuthenticator *authenticator) override {
50 emit q->proxyAuthenticationRequired(proxy, authenticator);
54 virtual bool bind(
const QHostAddress &address, quint16 port, QAbstractSocket::BindMode mode,
55 const QNetworkInterface *iface =
nullptr);
57 virtual bool canReadNotification();
58 bool canWriteNotification();
59 void canCloseNotification();
62 void _q_connectToNextAddress();
63 void _q_startConnecting(
const QHostInfo &hostInfo);
64 void _q_testConnection();
65 void _q_abortConnectionAttempt();
67 bool emittedReadyRead =
false;
68 bool emittedBytesWritten =
false;
70 bool abortCalled =
false;
71 bool pendingClose =
false;
73 QAbstractSocket::PauseModes pauseMode = QAbstractSocket::PauseNever;
78 QList<QHostAddress> addresses;
80 quint16 localPort = 0;
82 QHostAddress localAddress;
83 QHostAddress peerAddress;
86 QAbstractSocketEngine *socketEngine =
nullptr;
87 qintptr cachedSocketDescriptor = -1;
89#ifndef QT_NO_NETWORKPROXY
91 QNetworkProxy proxyInUse;
93 void resolveProxy(
const QString &hostName, quint16 port);
95 inline void resolveProxy(
const QString &, quint16) { }
97 inline void resolveProxy(quint16 port) { resolveProxy(QString(), port); }
99 void resetSocketLayer();
100 virtual bool flush();
102 bool initSocketLayer(QAbstractSocket::NetworkLayerProtocol protocol);
103 virtual void configureCreatedSocket();
104 void startConnectingByName(
const QString &host);
105 void fetchConnectionParameters();
106 bool readFromSocket();
107 virtual bool writeToSocket();
108 void emitReadyRead(
int channel = 0);
109 void emitBytesWritten(qint64 bytes,
int channel = 0);
111 void setError(QAbstractSocket::SocketError errorCode,
const QString &errorString);
112 void setErrorAndEmit(QAbstractSocket::SocketError errorCode,
const QString &errorString);
114 qint64 readBufferMaxSize = 0;
115 bool isBuffered =
false;
116 bool hasPendingData =
false;
117 bool hasPendingDatagram =
false;
119 QTimer *connectTimer =
nullptr;
121 int hostLookupId = -1;
123 QAbstractSocket::SocketType socketType = QAbstractSocket::UnknownSocketType;
124 QAbstractSocket::SocketState state = QAbstractSocket::UnconnectedState;
127 QAbstractSocket::SocketError socketError = QAbstractSocket::UnknownSocketError;
129 QAbstractSocket::NetworkLayerProtocol preferredNetworkLayerProtocol =
130 QAbstractSocket::UnknownNetworkLayerProtocol;
132 bool prePauseReadSocketNotifierState =
false;
133 bool prePauseWriteSocketNotifierState =
false;
134 bool prePauseExceptionSocketNotifierState =
false;
135 static void pauseSocketNotifiers(QAbstractSocket*);
136 static void resumeSocketNotifiers(QAbstractSocket*);
137 static QAbstractSocketEngine* getSocketEngine(QAbstractSocket*);