Qt 4.8
|
#include <qabstractsocket_p.h>
Public Functions | |
void | _q_abortConnectionAttempt () |
This function is called after a certain number of seconds has passed while waiting for a connection. More... | |
void | _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. More... | |
void | _q_forceDisconnect () |
void | _q_startConnecting (const QHostInfo &hostInfo) |
Slot connected to QHostInfo::lookupHost() in connectToHost(). More... | |
void | _q_testConnection () |
Tests if a connection has been established. More... | |
bool | canReadNotification () |
Slot connected to the read socket notifier. More... | |
bool | canWriteNotification () |
Slot connected to the write socket notifier. More... | |
void | connectionNotification () |
Slot connected to a notification of connection status change. More... | |
void | exceptionNotification () |
void | fetchConnectionParameters () |
Sets up the internal state after the connection has succeeded. More... | |
bool | flush () |
Writes pending data in the write buffers to the socket. More... | |
bool | initSocketLayer (QAbstractSocket::NetworkLayerProtocol protocol) |
Initializes the socket layer to by of type type, using the network layer protocol protocol. More... | |
void | proxyAuthenticationRequired (const QNetworkProxy &proxy, QAuthenticator *authenticator) |
QAbstractSocketPrivate () | |
Constructs a QAbstractSocketPrivate. More... | |
bool | readFromSocket () |
Reads data from the socket layer into the read buffer. More... | |
void | readNotification () |
void | resetSocketLayer () |
Resets the socket layer, clears the read and write buffers and deletes any socket notifiers. More... | |
void | resolveProxy (const QString &hostName, quint16 port) |
Resolve the proxy to its final value. More... | |
void | resolveProxy (quint16 port) |
void | setupSocketNotifiers () |
void | startConnectingByName (const QString &host) |
Starts the connection to host, like _q_startConnecting below, but without hostname resolution. More... | |
void | writeNotification () |
virtual | ~QAbstractSocketPrivate () |
Destructs the QAbstractSocket. More... | |
Public Functions inherited from QIODevicePrivate | |
bool | isSequential () const |
virtual qint64 | peek (char *data, qint64 maxSize) |
virtual QByteArray | peek (qint64 maxSize) |
virtual bool | putCharHelper (char c) |
QIODevicePrivate () | |
virtual | ~QIODevicePrivate () |
Public Functions inherited from QObjectPrivate | |
void | _q_reregisterTimers (void *pointer) |
void | addConnection (int signal, Connection *c) |
void | cleanConnectionLists () |
void | connectNotify (const char *signal) |
void | deleteChildren () |
void | disconnectNotify (const char *signal) |
bool | isSender (const QObject *receiver, const char *signal) const |
bool | isSignalConnected (uint signalIdx) const |
Returns true if the signal with index signal_index from object sender is connected. More... | |
void | moveToThread_helper () |
QObjectPrivate (int version=QObjectPrivateVersion) | |
QObjectList | receiverList (const char *signal) const |
QObjectList | senderList () const |
void | setParent_helper (QObject *) |
void | setThreadData_helper (QThreadData *currentData, QThreadData *targetData) |
int | signalIndex (const char *signalName) const |
Returns the signal index used in the internal connectionLists vector. More... | |
virtual | ~QObjectPrivate () |
Public Functions inherited from QObjectData | |
virtual | ~QObjectData ()=0 |
Public Functions inherited from QAbstractSocketEngineReceiver | |
virtual | ~QAbstractSocketEngineReceiver () |
Static Public Functions | |
static QAbstractSocketEngine * | getSocketEngine (QAbstractSocket *) |
static void | pauseSocketNotifiers (QAbstractSocket *) |
static void | resumeSocketNotifiers (QAbstractSocket *) |
Static Public Functions inherited from QObjectPrivate | |
static void | clearGuards (QObject *) |
static QObjectPrivate * | get (QObject *o) |
static void | resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender) |
static Sender * | setCurrentSender (QObject *receiver, Sender *sender) |
static void | signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result) |
Additional Inherited Members | |
Public Types inherited from QIODevicePrivate | |
enum | AccessMode { Unset, Sequential, RandomAccess } |
Public Types inherited from QObjectPrivate | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
Definition at line 69 of file qabstractsocket_p.h.
QAbstractSocketPrivate::QAbstractSocketPrivate | ( | ) |
Constructs a QAbstractSocketPrivate.
Initializes all members.
Definition at line 500 of file qabstractsocket.cpp.
|
virtual |
Destructs the QAbstractSocket.
If the socket layer is open, it will be reset.
Definition at line 537 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 1171 of file qabstractsocket.cpp.
Referenced by _q_connectToNextAddress(), and proxyAuthenticationRequired().
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, error(ConnectionRefusedError) or error(SocketTimeoutError) is emitted.
Definition at line 1018 of file qabstractsocket.cpp.
Referenced by _q_abortConnectionAttempt(), _q_startConnecting(), _q_testConnection(), and proxyAuthenticationRequired().
void QAbstractSocketPrivate::_q_forceDisconnect | ( | ) |
Definition at line 1193 of file qabstractsocket.cpp.
Referenced by proxyAuthenticationRequired().
void QAbstractSocketPrivate::_q_startConnecting | ( | const QHostInfo & | hostInfo | ) |
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 951 of file qabstractsocket.cpp.
Referenced by proxyAuthenticationRequired().
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 1125 of file qabstractsocket.cpp.
Referenced by connectionNotification(), and proxyAuthenticationRequired().
bool QAbstractSocketPrivate::canReadNotification | ( | ) |
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.
Definition at line 641 of file qabstractsocket.cpp.
Referenced by proxyAuthenticationRequired(), and 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 735 of file qabstractsocket.cpp.
Referenced by proxyAuthenticationRequired(), and writeNotification().
|
virtual |
Slot connected to a notification of connection status change.
Either we finished connecting or we failed to connect.
Implements QAbstractSocketEngineReceiver.
Definition at line 769 of file qabstractsocket.cpp.
Referenced by exceptionNotification().
|
inlinevirtual |
void QAbstractSocketPrivate::fetchConnectionParameters | ( | ) |
Sets up the internal state after the connection has succeeded.
Definition at line 1269 of file qabstractsocket.cpp.
Referenced by _q_connectToNextAddress(), _q_testConnection(), and resolveProxy().
bool QAbstractSocketPrivate::flush | ( | ) |
Writes pending data in the write buffers to the socket.
The function writes as much as it can without blocking.
It is usually invoked by canWriteNotification after one or more calls to write().
Emits bytesWritten().
Definition at line 794 of file qabstractsocket.cpp.
Referenced by canWriteNotification(), and resolveProxy().
|
static |
Definition at line 1318 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 577 of file qabstractsocket.cpp.
Referenced by _q_connectToNextAddress(), QUdpSocketPrivate::doEnsureInitialized(), resolveProxy(), and startConnectingByName().
|
static |
Definition at line 1295 of file qabstractsocket.cpp.
Referenced by QHttpNetworkConnectionPrivate::pauseConnection(), and QSslSocketPrivate::pauseSocketNotifiers().
|
inlinevirtual |
Implements QAbstractSocketEngineReceiver.
Definition at line 82 of file qabstractsocket_p.h.
Referenced by QSslSocketPrivate::createPlainSocket().
bool QAbstractSocketPrivate::readFromSocket | ( | ) |
Reads data from the socket layer into the read buffer.
Returns true on success; otherwise false.
Definition at line 1210 of file qabstractsocket.cpp.
Referenced by canReadNotification(), and resolveProxy().
|
inlinevirtual |
Implements QAbstractSocketEngineReceiver.
Definition at line 77 of file qabstractsocket_p.h.
void QAbstractSocketPrivate::resetSocketLayer | ( | ) |
Resets the socket layer, clears the read and write buffers and deletes any socket notifiers.
Definition at line 549 of file qabstractsocket.cpp.
Referenced by initSocketLayer(), readFromSocket(), and resolveProxy().
Resolve the proxy to its final value.
Definition at line 861 of file qabstractsocket.cpp.
Referenced by QUdpSocketPrivate::doEnsureInitialized().
|
inline |
Definition at line 130 of file qabstractsocket_p.h.
Referenced by resolveProxy().
|
static |
Definition at line 1308 of file qabstractsocket.cpp.
Referenced by QHttpNetworkConnectionPrivate::resumeConnection(), and QSslSocketPrivate::resumeSocketNotifiers().
void QAbstractSocketPrivate::setupSocketNotifiers | ( | ) |
Referenced by resolveProxy().
void QAbstractSocketPrivate::startConnectingByName | ( | const QString & | host | ) |
Starts the connection to host, like _q_startConnecting below, but without hostname resolution.
Definition at line 905 of file qabstractsocket.cpp.
Referenced by resolveProxy().
|
inlinevirtual |
Implements QAbstractSocketEngineReceiver.
Definition at line 78 of file qabstractsocket_p.h.
bool QAbstractSocketPrivate::abortCalled |
Definition at line 105 of file qabstractsocket_p.h.
QList<QHostAddress> QAbstractSocketPrivate::addresses |
Definition at line 112 of file qabstractsocket_p.h.
Referenced by _q_abortConnectionAttempt(), _q_connectToNextAddress(), _q_startConnecting(), and _q_testConnection().
int QAbstractSocketPrivate::blockingTimeout |
Definition at line 146 of file qabstractsocket_p.h.
int QAbstractSocketPrivate::cachedSocketDescriptor |
Definition at line 121 of file qabstractsocket_p.h.
Referenced by QSslSocketPrivate::_q_connectedSlot(), _q_connectToNextAddress(), fetchConnectionParameters(), resetSocketLayer(), and startConnectingByName().
bool QAbstractSocketPrivate::closeCalled |
Definition at line 106 of file qabstractsocket_p.h.
int QAbstractSocketPrivate::connectTimeElapsed |
Definition at line 150 of file qabstractsocket_p.h.
Referenced by _q_startConnecting(), and startConnectingByName().
QTimer* QAbstractSocketPrivate::connectTimer |
Definition at line 148 of file qabstractsocket_p.h.
Referenced by _q_abortConnectionAttempt(), _q_connectToNextAddress(), _q_testConnection(), and resetSocketLayer().
QTimer* QAbstractSocketPrivate::disconnectTimer |
Definition at line 149 of file qabstractsocket_p.h.
Referenced by resetSocketLayer().
bool QAbstractSocketPrivate::emittedBytesWritten |
Definition at line 103 of file qabstractsocket_p.h.
Referenced by flush(), and QSslSocketBackendPrivate::transmit().
bool QAbstractSocketPrivate::emittedReadyRead |
Definition at line 102 of file qabstractsocket_p.h.
Referenced by canReadNotification().
QHostAddress QAbstractSocketPrivate::host |
Definition at line 111 of file qabstractsocket_p.h.
Referenced by _q_connectToNextAddress(), and fetchConnectionParameters().
int QAbstractSocketPrivate::hostLookupId |
Definition at line 152 of file qabstractsocket_p.h.
Referenced by _q_startConnecting().
QString QAbstractSocketPrivate::hostName |
Definition at line 109 of file qabstractsocket_p.h.
Referenced by QSslSocketPrivate::_q_connectedSlot(), fetchConnectionParameters(), and QSslSocketBackendPrivate::initSslContext().
bool QAbstractSocketPrivate::isBuffered |
Definition at line 145 of file qabstractsocket_p.h.
Referenced by canReadNotification().
QHostAddress QAbstractSocketPrivate::localAddress |
Definition at line 116 of file qabstractsocket_p.h.
Referenced by fetchConnectionParameters().
quint16 QAbstractSocketPrivate::localPort |
Definition at line 114 of file qabstractsocket_p.h.
Referenced by fetchConnectionParameters().
QHostAddress QAbstractSocketPrivate::peerAddress |
Definition at line 117 of file qabstractsocket_p.h.
Referenced by fetchConnectionParameters().
QString QAbstractSocketPrivate::peerName |
Definition at line 118 of file qabstractsocket_p.h.
Referenced by fetchConnectionParameters(), and QSslSocketBackendPrivate::startHandshake().
quint16 QAbstractSocketPrivate::peerPort |
Definition at line 115 of file qabstractsocket_p.h.
Referenced by fetchConnectionParameters().
bool QAbstractSocketPrivate::pendingClose |
Definition at line 107 of file qabstractsocket_p.h.
Referenced by QSslSocketPrivate::_q_connectedSlot(), _q_testConnection(), and QSslSocketBackendPrivate::startHandshake().
quint16 QAbstractSocketPrivate::port |
Definition at line 110 of file qabstractsocket_p.h.
Referenced by _q_connectToNextAddress(), fetchConnectionParameters(), and startConnectingByName().
bool QAbstractSocketPrivate::prePauseExceptionSocketNotifierState |
Definition at line 161 of file qabstractsocket_p.h.
bool QAbstractSocketPrivate::prePauseReadSocketNotifierState |
Definition at line 159 of file qabstractsocket_p.h.
bool QAbstractSocketPrivate::prePauseWriteSocketNotifierState |
Definition at line 160 of file qabstractsocket_p.h.
QNetworkProxy QAbstractSocketPrivate::proxy |
Definition at line 124 of file qabstractsocket_p.h.
Referenced by resolveProxy().
QNetworkProxy QAbstractSocketPrivate::proxyInUse |
Definition at line 125 of file qabstractsocket_p.h.
Referenced by initSocketLayer(), and resolveProxy().
QRingBuffer QAbstractSocketPrivate::readBuffer |
Definition at line 142 of file qabstractsocket_p.h.
Referenced by canReadNotification(), QSslSocketPrivate::createPlainSocket(), QSslSocketPrivate::init(), readFromSocket(), and QSslSocketBackendPrivate::transmit().
qint64 QAbstractSocketPrivate::readBufferMaxSize |
Definition at line 141 of file qabstractsocket_p.h.
Referenced by canReadNotification(), QSslSocketPrivate::createPlainSocket(), readFromSocket(), QSslSocketBackendPrivate::startHandshake(), and QSslSocketBackendPrivate::transmit().
bool QAbstractSocketPrivate::readSocketNotifierCalled |
Definition at line 98 of file qabstractsocket_p.h.
Referenced by canReadNotification().
bool QAbstractSocketPrivate::readSocketNotifierState |
Definition at line 99 of file qabstractsocket_p.h.
Referenced by canReadNotification().
bool QAbstractSocketPrivate::readSocketNotifierStateSet |
Definition at line 100 of file qabstractsocket_p.h.
Referenced by canReadNotification().
QAbstractSocketEngine* QAbstractSocketPrivate::socketEngine |
Definition at line 120 of file qabstractsocket_p.h.
Referenced by _q_abortConnectionAttempt(), _q_connectToNextAddress(), _q_forceDisconnect(), _q_testConnection(), canReadNotification(), canWriteNotification(), QUdpSocketPrivate::doEnsureInitialized(), fetchConnectionParameters(), flush(), initSocketLayer(), pauseSocketNotifiers(), readFromSocket(), resetSocketLayer(), resumeSocketNotifiers(), and startConnectingByName().
QAbstractSocket::SocketError QAbstractSocketPrivate::socketError |
Definition at line 157 of file qabstractsocket_p.h.
Referenced by _q_abortConnectionAttempt(), _q_connectToNextAddress(), _q_startConnecting(), QUdpSocketPrivate::doEnsureInitialized(), flush(), initSocketLayer(), readFromSocket(), and startConnectingByName().
QAbstractSocket::SocketType QAbstractSocketPrivate::socketType |
Definition at line 154 of file qabstractsocket_p.h.
Referenced by canReadNotification(), and resolveProxy().
QAbstractSocket::SocketState QAbstractSocketPrivate::state |
Definition at line 155 of file qabstractsocket_p.h.
Referenced by _q_abortConnectionAttempt(), QSslSocketPrivate::_q_bytesWrittenSlot(), _q_connectToNextAddress(), _q_forceDisconnect(), _q_startConnecting(), canReadNotification(), connectionNotification(), fetchConnectionParameters(), flush(), and startConnectingByName().
QRingBuffer QAbstractSocketPrivate::writeBuffer |
Definition at line 143 of file qabstractsocket_p.h.
Referenced by QSslSocketPrivate::_q_bytesWrittenSlot(), QSslSocketPrivate::_q_flushWriteBuffer(), canWriteNotification(), QSslSocketPrivate::createPlainSocket(), flush(), QSslSocketPrivate::init(), and QSslSocketBackendPrivate::transmit().