![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qabstractsocket_p.h>
Static Public Member Functions | |
static void | pauseSocketNotifiers (QAbstractSocket *) |
static void | resumeSocketNotifiers (QAbstractSocket *) |
static QAbstractSocketEngine * | getSocketEngine (QAbstractSocket *) |
![]() | |
static bool | removeConnection (Connection *c) |
static QObjectPrivate * | get (QObject *o) |
static const QObjectPrivate * | get (const QObject *o) |
template<typename Func1, typename Func2> | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1, typename Func2> | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot) |
static QMetaObject::Connection | connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static bool | disconnect (const QObject *sender, int signal_index, void **slot) |
static bool | disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot) |
Additional Inherited Members | |
![]() | |
enum class | ReadLineOption { NotNullTerminated , NullTerminated } |
enum | AccessMode : quint8 { Unset , Sequential , RandomAccess } |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData> |
Definition at line 31 of file qabstractsocket_p.h.
QAbstractSocketPrivate::QAbstractSocketPrivate | ( | decltype(QObjectPrivateVersion) | version = QObjectPrivateVersion | ) |
Constructs a QAbstractSocketPrivate. Initializes all members.
Definition at line 496 of file qabstractsocket.cpp.
|
virtual |
Destructs the QAbstractSocket. If the socket layer is open, it will be reset.
Definition at line 507 of file qabstractsocket.cpp.
void QAbstractSocketPrivate::_q_abortConnectionAttempt | ( | ) |
This function is called after a certain number of seconds has passed while waiting for a connection. It simply tests the connection, and continues to the next address if the connection failed.
Definition at line 1123 of file qabstractsocket.cpp.
References _q_connectToNextAddress().
void QAbstractSocketPrivate::_q_connectToNextAddress | ( | ) |
Called by a queued or direct connection from _q_startConnecting() or _q_testConnection(), this function takes the first address of the pending addresses list and tries to connect to it. If the connection succeeds, QAbstractSocket will emit connected(). Otherwise, errorOccurred(ConnectionRefusedError) or errorOccurred(SocketTimeoutError) is emitted.
Definition at line 997 of file qabstractsocket.cpp.
References fetchConnectionParameters().
Referenced by _q_abortConnectionAttempt(), _q_startConnecting(), and _q_testConnection().
Slot connected to QHostInfo::lookupHost() in connectToHost(). This function starts the process of connecting to any number of candidate IP addresses for the host, if it was found. Calls _q_connectToNextAddress().
Definition at line 925 of file qabstractsocket.cpp.
References _q_connectToNextAddress(), and hostLookupId.
void QAbstractSocketPrivate::_q_testConnection | ( | ) |
Tests if a connection has been established. If it has, connected() is emitted. Otherwise, _q_connectToNextAddress() is invoked.
Definition at line 1087 of file qabstractsocket.cpp.
References _q_connectToNextAddress(), fetchConnectionParameters(), and pendingClose.
Referenced by connectionNotification().
|
virtual |
Reimplemented in QSslSocketPrivate.
Definition at line 1503 of file qabstractsocket.cpp.
void QAbstractSocketPrivate::canCloseNotification | ( | ) |
Slot connected to the close socket notifier. It's called when the socket is closed.
Definition at line 674 of file qabstractsocket.cpp.
References emitReadyRead(), isBuffered, and readFromSocket().
Referenced by closeNotification().
|
virtual |
Slot connected to the read socket notifier. This slot is called when new data is available for reading, or when the socket has been closed. Handles recursive calls.
Reimplemented in QSctpSocketPrivate.
Definition at line 606 of file qabstractsocket.cpp.
References emitReadyRead(), hasPendingData, hasPendingDatagram, isBuffered, and readFromSocket().
Referenced by readNotification().
bool QAbstractSocketPrivate::canWriteNotification | ( | ) |
Slot connected to the write socket notifier. It's called during a delayed connect or when the socket is ready for writing.
Definition at line 718 of file qabstractsocket.cpp.
References writeToSocket().
Referenced by writeNotification().
|
inlineoverridevirtual |
Implements QAbstractSocketEngineReceiver.
Definition at line 42 of file qabstractsocket_p.h.
References canCloseNotification().
|
virtual |
Reimplemented in QSctpSocketPrivate.
Definition at line 590 of file qabstractsocket.cpp.
Referenced by initSocketLayer().
|
overridevirtual |
Slot connected to a notification of connection status change. Either we finished connecting or we failed to connect.
Implements QAbstractSocketEngineReceiver.
Definition at line 732 of file qabstractsocket.cpp.
References _q_testConnection().
Emits bytesWritten(), protecting against recursion.
Definition at line 1233 of file qabstractsocket.cpp.
References emittedBytesWritten.
void QAbstractSocketPrivate::emitReadyRead | ( | int | channel = 0 | ) |
Emits readyRead(), protecting against recursion.
Definition at line 1216 of file qabstractsocket.cpp.
References emittedReadyRead.
Referenced by canCloseNotification(), and canReadNotification().
|
inlineoverridevirtual |
Implements QAbstractSocketEngineReceiver.
Definition at line 41 of file qabstractsocket_p.h.
void QAbstractSocketPrivate::fetchConnectionParameters | ( | ) |
Sets up the internal state after the connection has succeeded.
Definition at line 1250 of file qabstractsocket.cpp.
Referenced by _q_connectToNextAddress(), _q_testConnection(), and startConnectingByName().
|
virtual |
Writes pending data in the write buffers to the socket. The function writes as much as it can without blocking. If any data was written, this function returns true; otherwise false is returned.
Reimplemented in QSslSocketPrivate.
Definition at line 817 of file qabstractsocket.cpp.
References writeToSocket().
Referenced by testing.tools.encode_pdf_filter._SinkPdfStream::close().
|
static |
Definition at line 1355 of file qabstractsocket.cpp.
bool QAbstractSocketPrivate::initSocketLayer | ( | QAbstractSocket::NetworkLayerProtocol | protocol | ) |
Initializes the socket layer to by of type type, using the network layer protocol protocol. Resets the socket layer first if it's already initialized. Sets up the socket notifiers.
Definition at line 539 of file qabstractsocket.cpp.
References configureCreatedSocket(), and resetSocketLayer().
|
static |
Definition at line 1305 of file qabstractsocket.cpp.
|
inlineoverridevirtual |
Implements QAbstractSocketEngineReceiver.
Definition at line 45 of file qabstractsocket_p.h.
bool QAbstractSocketPrivate::readFromSocket | ( | ) |
Reads data from the socket layer into the read buffer. Returns true on success; otherwise false.
Definition at line 1150 of file qabstractsocket.cpp.
References resetSocketLayer().
Referenced by canCloseNotification(), and canReadNotification().
|
inlineoverridevirtual |
Implements QAbstractSocketEngineReceiver.
Definition at line 39 of file qabstractsocket_p.h.
References canReadNotification().
void QAbstractSocketPrivate::resetSocketLayer | ( | ) |
Resets the socket layer and deletes any socket notifiers.
Definition at line 515 of file qabstractsocket.cpp.
References hasPendingData.
Referenced by initSocketLayer(), and readFromSocket().
Resolve the proxy to its final value.
Definition at line 832 of file qabstractsocket.cpp.
Definition at line 93 of file qabstractsocket_p.h.
|
static |
Definition at line 1335 of file qabstractsocket.cpp.
void QAbstractSocketPrivate::setError | ( | QAbstractSocket::SocketError | errorCode, |
const QString & | errStr ) |
Sets the socket error state to errorCode
and errorString.
Definition at line 1365 of file qabstractsocket.cpp.
void QAbstractSocketPrivate::setErrorAndEmit | ( | QAbstractSocket::SocketError | errorCode, |
const QString & | errorString ) |
Sets the socket error state to errorCode
and errorString, and emits the QAbstractSocket::errorOccurred() signal.
Definition at line 1378 of file qabstractsocket.cpp.
Starts the connection to host, like _q_startConnecting below, but without hostname resolution.
Definition at line 881 of file qabstractsocket.cpp.
References fetchConnectionParameters().
|
inlineoverridevirtual |
Implements QAbstractSocketEngineReceiver.
Definition at line 40 of file qabstractsocket_p.h.
References canWriteNotification().
|
virtual |
Writes one pending data block in the write buffer to the socket.
It is usually invoked by canWriteNotification after one or more calls to write().
Emits bytesWritten().
Reimplemented in QSctpSocketPrivate.
Definition at line 753 of file qabstractsocket.cpp.
Referenced by canWriteNotification(), and flush().
bool QAbstractSocketPrivate::abortCalled = false |
Definition at line 66 of file qabstractsocket_p.h.
QList<QHostAddress> QAbstractSocketPrivate::addresses |
Definition at line 74 of file qabstractsocket_p.h.
qintptr QAbstractSocketPrivate::cachedSocketDescriptor = -1 |
Definition at line 83 of file qabstractsocket_p.h.
QTimer* QAbstractSocketPrivate::connectTimer = nullptr |
Definition at line 115 of file qabstractsocket_p.h.
bool QAbstractSocketPrivate::emittedBytesWritten = false |
Definition at line 64 of file qabstractsocket_p.h.
Referenced by emitBytesWritten().
bool QAbstractSocketPrivate::emittedReadyRead = false |
Definition at line 63 of file qabstractsocket_p.h.
Referenced by emitReadyRead().
bool QAbstractSocketPrivate::hasPendingData = false |
Definition at line 112 of file qabstractsocket_p.h.
Referenced by canReadNotification(), and resetSocketLayer().
bool QAbstractSocketPrivate::hasPendingDatagram = false |
Definition at line 113 of file qabstractsocket_p.h.
Referenced by canReadNotification().
QHostAddress QAbstractSocketPrivate::host |
Definition at line 73 of file qabstractsocket_p.h.
int QAbstractSocketPrivate::hostLookupId = -1 |
Definition at line 117 of file qabstractsocket_p.h.
Referenced by _q_startConnecting().
QString QAbstractSocketPrivate::hostName |
Definition at line 71 of file qabstractsocket_p.h.
bool QAbstractSocketPrivate::isBuffered = false |
Definition at line 111 of file qabstractsocket_p.h.
Referenced by canCloseNotification(), and canReadNotification().
QHostAddress QAbstractSocketPrivate::localAddress |
Definition at line 78 of file qabstractsocket_p.h.
quint16 QAbstractSocketPrivate::localPort = 0 |
Definition at line 76 of file qabstractsocket_p.h.
QAbstractSocket::PauseModes QAbstractSocketPrivate::pauseMode = QAbstractSocket::PauseNever |
Definition at line 69 of file qabstractsocket_p.h.
QHostAddress QAbstractSocketPrivate::peerAddress |
Definition at line 79 of file qabstractsocket_p.h.
QString QAbstractSocketPrivate::peerName |
Definition at line 80 of file qabstractsocket_p.h.
quint16 QAbstractSocketPrivate::peerPort = 0 |
Definition at line 77 of file qabstractsocket_p.h.
bool QAbstractSocketPrivate::pendingClose = false |
Definition at line 67 of file qabstractsocket_p.h.
Referenced by _q_testConnection().
quint16 QAbstractSocketPrivate::port = 0 |
Definition at line 72 of file qabstractsocket_p.h.
QAbstractSocket::NetworkLayerProtocol QAbstractSocketPrivate::preferredNetworkLayerProtocol |
Definition at line 125 of file qabstractsocket_p.h.
bool QAbstractSocketPrivate::prePauseExceptionSocketNotifierState = false |
Definition at line 130 of file qabstractsocket_p.h.
bool QAbstractSocketPrivate::prePauseReadSocketNotifierState = false |
Definition at line 128 of file qabstractsocket_p.h.
bool QAbstractSocketPrivate::prePauseWriteSocketNotifierState = false |
Definition at line 129 of file qabstractsocket_p.h.
QString QAbstractSocketPrivate::protocolTag |
Definition at line 88 of file qabstractsocket_p.h.
QNetworkProxy QAbstractSocketPrivate::proxy |
Definition at line 86 of file qabstractsocket_p.h.
QNetworkProxy QAbstractSocketPrivate::proxyInUse |
Definition at line 87 of file qabstractsocket_p.h.
qint64 QAbstractSocketPrivate::readBufferMaxSize = 0 |
Definition at line 110 of file qabstractsocket_p.h.
QAbstractSocketEngine* QAbstractSocketPrivate::socketEngine = nullptr |
Definition at line 82 of file qabstractsocket_p.h.
QAbstractSocket::SocketError QAbstractSocketPrivate::socketError = QAbstractSocket::UnknownSocketError |
Definition at line 123 of file qabstractsocket_p.h.
QAbstractSocket::SocketType QAbstractSocketPrivate::socketType = QAbstractSocket::UnknownSocketType |
Definition at line 119 of file qabstractsocket_p.h.
QAbstractSocket::SocketState QAbstractSocketPrivate::state = QAbstractSocket::UnconnectedState |
Definition at line 120 of file qabstractsocket_p.h.