Qt 4.8
Public Functions | Private Functions | List of all members
QUdpSocketPrivate Class Reference
Inheritance diagram for QUdpSocketPrivate:
QAbstractSocketPrivate QIODevicePrivate QAbstractSocketEngineReceiver QObjectPrivate QObjectData

Public Functions

bool ensureInitialized (const QHostAddress &bindAddress, quint16 bindPort)
 
bool ensureInitialized (const QHostAddress &remoteAddress)
 
- Public Functions inherited from QAbstractSocketPrivate
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 ()
 

Private Functions

bool doEnsureInitialized (const QHostAddress &bindAddress, quint16 bindPort, const QHostAddress &remoteAddress)
 

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 **)
 
- Static Public Functions inherited from QAbstractSocketPrivate
static QAbstractSocketEnginegetSocketEngine (QAbstractSocket *)
 
static void pauseSocketNotifiers (QAbstractSocket *)
 
static void resumeSocketNotifiers (QAbstractSocket *)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 
- Public Variables inherited from QAbstractSocketPrivate
bool abortCalled
 
QList< QHostAddressaddresses
 
int blockingTimeout
 
int cachedSocketDescriptor
 
bool closeCalled
 
int connectTimeElapsed
 
QTimerconnectTimer
 
QTimerdisconnectTimer
 
bool emittedBytesWritten
 
bool emittedReadyRead
 
QHostAddress host
 
int hostLookupId
 
QString hostName
 
bool isBuffered
 
QHostAddress localAddress
 
quint16 localPort
 
QHostAddress peerAddress
 
QString peerName
 
quint16 peerPort
 
bool pendingClose
 
quint16 port
 
bool prePauseExceptionSocketNotifierState
 
bool prePauseReadSocketNotifierState
 
bool prePauseWriteSocketNotifierState
 
QNetworkProxy proxy
 
QNetworkProxy proxyInUse
 
QRingBuffer readBuffer
 
qint64 readBufferMaxSize
 
bool readSocketNotifierCalled
 
bool readSocketNotifierState
 
bool readSocketNotifierStateSet
 
QAbstractSocketEnginesocketEngine
 
QAbstractSocket::SocketError socketError
 
QAbstractSocket::SocketType socketType
 
QAbstractSocket::SocketState state
 
QRingBuffer writeBuffer
 
- Public Variables inherited from QIODevicePrivate
AccessMode accessMode
 
bool baseReadLineDataCalled
 
QIODevicePrivateLinearBuffer buffer
 
qint64 devicePos
 
QString errorString
 
bool firstRead
 
QIODevice::OpenMode openMode
 
qint64pDevicePos
 
qint64 pos
 
qint64pPos
 
qint64 seqDumpPos
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Detailed Description

Definition at line 177 of file qudpsocket.cpp.

Functions

◆ doEnsureInitialized()

bool QUdpSocketPrivate::doEnsureInitialized ( const QHostAddress bindAddress,
quint16  bindPort,
const QHostAddress remoteAddress 
)
private

Definition at line 191 of file qudpsocket.cpp.

Referenced by ensureInitialized().

193 {
194  const QHostAddress *address = &bindAddress;
197  address = &remoteAddress;
198  proto = address->protocol();
199  }
200 
201 #if defined(QT_NO_IPV6)
202  Q_Q(QUdpSocket);
203  if (proto == QUdpSocket::IPv6Protocol) {
205  q->setErrorString(QUdpSocket::tr("This platform does not support IPv6"));
206  return false;
207  }
208 #endif
209 
210  // now check if the socket engine is initialized and to the right type
211  if (!socketEngine || !socketEngine->isValid()) {
212  resolveProxy(remoteAddress.toString(), bindPort);
213  if (!initSocketLayer(address->protocol()))
214  return false;
215  }
216 
217  return true;
218 }
The QUdpSocket class provides a UDP socket.
Definition: qudpsocket.h:59
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
NetworkLayerProtocol
This enum describes the network layer protocol values used in Qt.
#define Q_Q(Class)
Definition: qglobal.h:2483
QAbstractSocket::SocketError socketError
QString toString() const
Returns the address as a string.
QAbstractSocket::NetworkLayerProtocol protocol() const
Returns the network layer protocol of the host address.
QAbstractSocketEngine * socketEngine
bool initSocketLayer(QAbstractSocket::NetworkLayerProtocol protocol)
Initializes the socket layer to by of type type, using the network layer protocol protocol...
void resolveProxy(const QString &hostName, quint16 port)
Resolve the proxy to its final value.
virtual bool isValid() const =0
The QHostAddress class provides an IP address.
Definition: qhostaddress.h:70

◆ ensureInitialized() [1/2]

bool QUdpSocketPrivate::ensureInitialized ( const QHostAddress bindAddress,
quint16  bindPort 
)
inline

Definition at line 184 of file qudpsocket.cpp.

185  { return doEnsureInitialized(bindAddress, bindPort, QHostAddress()); }
bool doEnsureInitialized(const QHostAddress &bindAddress, quint16 bindPort, const QHostAddress &remoteAddress)
Definition: qudpsocket.cpp:191
The QHostAddress class provides an IP address.
Definition: qhostaddress.h:70

◆ ensureInitialized() [2/2]

bool QUdpSocketPrivate::ensureInitialized ( const QHostAddress remoteAddress)
inline

Definition at line 187 of file qudpsocket.cpp.

188  { return doEnsureInitialized(QHostAddress(), 0, remoteAddress); }
bool doEnsureInitialized(const QHostAddress &bindAddress, quint16 bindPort, const QHostAddress &remoteAddress)
Definition: qudpsocket.cpp:191
The QHostAddress class provides an IP address.
Definition: qhostaddress.h:70

The documentation for this class was generated from the following file: