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
QNativeSocketEnginePrivate Class Reference

#include <qnativesocketengine_p_p.h>

+ Inheritance diagram for QNativeSocketEnginePrivate:
+ Collaboration diagram for QNativeSocketEnginePrivate:

Public Types

enum  ErrorString {
  NonBlockingInitFailedErrorString , BroadcastingInitFailedErrorString , NoIpV6ErrorString , RemoteHostClosedErrorString ,
  TimeOutErrorString , ResourceErrorString , OperationUnsupportedErrorString , ProtocolUnsupportedErrorString ,
  InvalidSocketErrorString , HostUnreachableErrorString , NetworkUnreachableErrorString , AccessErrorString ,
  ConnectionTimeOutErrorString , ConnectionRefusedErrorString , AddressInuseErrorString , AddressNotAvailableErrorString ,
  AddressProtectedErrorString , DatagramTooLargeErrorString , SendDatagramErrorString , ReceiveDatagramErrorString ,
  WriteErrorString , ReadErrorString , PortInuseErrorString , NotSocketErrorString ,
  InvalidProxyTypeString , TemporaryErrorString , NetworkDroppedConnectionErrorString , ConnectionResetErrorString ,
  UnknownSocketErrorString = -1
}
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>
 

Public Member Functions

 QNativeSocketEnginePrivate ()
 
 ~QNativeSocketEnginePrivate ()
 
void setError (QAbstractSocket::SocketError error, ErrorString errorString) const
 
QHostAddress adjustAddressProtocol (const QHostAddress &address) const
 
int option (QNativeSocketEngine::SocketOption option) const
 
bool setOption (QNativeSocketEngine::SocketOption option, int value)
 
bool createNewSocket (QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol &protocol)
 
bool nativeConnect (const QHostAddress &address, quint16 port)
 
bool nativeBind (const QHostAddress &address, quint16 port)
 
bool nativeListen (int backlog)
 
qintptr nativeAccept ()
 
bool nativeJoinMulticastGroup (const QHostAddress &groupAddress, const QNetworkInterface &iface)
 
bool nativeLeaveMulticastGroup (const QHostAddress &groupAddress, const QNetworkInterface &iface)
 
QNetworkInterface nativeMulticastInterface () const
 
bool nativeSetMulticastInterface (const QNetworkInterface &iface)
 
qint64 nativeBytesAvailable () const
 
bool nativeHasPendingDatagrams () const
 
qint64 nativePendingDatagramSize () const
 
qint64 nativeReceiveDatagram (char *data, qint64 maxLength, QIpPacketHeader *header, QAbstractSocketEngine::PacketHeaderOptions options)
 
qint64 nativeSendDatagram (const char *data, qint64 length, const QIpPacketHeader &header)
 
qint64 nativeRead (char *data, qint64 maxLength)
 
qint64 nativeWrite (const char *data, qint64 length)
 
int nativeSelect (QDeadlineTimer deadline, bool selectForRead) const
 
int nativeSelect (QDeadlineTimer deadline, bool checkRead, bool checkWrite, bool *selectForRead, bool *selectForWrite) const
 
void nativeClose ()
 
bool checkProxy (const QHostAddress &address)
 
bool fetchConnectionParameters ()
 Fetches information about both ends of the connection: whatever is available.
 
void setPortAndAddress (quint16 port, const QHostAddress &address, qt_sockaddr *aa, QT_SOCKLEN_T *sockAddrSize)
 
- Public Member Functions inherited from QAbstractSocketEnginePrivate
 QAbstractSocketEnginePrivate ()
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
QObjectList receiverList (const char *signal) const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
virtual void writeToDebugStream (QDebug &) const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

Public Attributes

qintptr socketDescriptor
 
QSocketNotifierreadNotifier
 
QSocketNotifierwriteNotifier
 
QSocketNotifierexceptNotifier
 
- Public Attributes inherited from QAbstractSocketEnginePrivate
QAbstractSocket::SocketError socketError
 
bool hasSetSocketError
 
QString socketErrorString
 
QAbstractSocket::SocketState socketState
 
QAbstractSocket::SocketType socketType
 
QAbstractSocket::NetworkLayerProtocol socketProtocol
 
QHostAddress localAddress
 
quint16 localPort
 
QHostAddress peerAddress
 
quint16 peerPort
 
int inboundStreamCount
 
int outboundStreamCount
 
QAbstractSocketEngineReceiverreceiver
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint receiveParentEvents: 1
 
uint unused: 20
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Additional Inherited Members

- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (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)
 

Detailed Description

Definition at line 71 of file qnativesocketengine_p_p.h.

Member Enumeration Documentation

◆ ErrorString

Enumerator
NonBlockingInitFailedErrorString 
BroadcastingInitFailedErrorString 
NoIpV6ErrorString 
RemoteHostClosedErrorString 
TimeOutErrorString 
ResourceErrorString 
OperationUnsupportedErrorString 
ProtocolUnsupportedErrorString 
InvalidSocketErrorString 
HostUnreachableErrorString 
NetworkUnreachableErrorString 
AccessErrorString 
ConnectionTimeOutErrorString 
ConnectionRefusedErrorString 
AddressInuseErrorString 
AddressNotAvailableErrorString 
AddressProtectedErrorString 
DatagramTooLargeErrorString 
SendDatagramErrorString 
ReceiveDatagramErrorString 
WriteErrorString 
ReadErrorString 
PortInuseErrorString 
NotSocketErrorString 
InvalidProxyTypeString 
TemporaryErrorString 
NetworkDroppedConnectionErrorString 
ConnectionResetErrorString 
UnknownSocketErrorString 

Definition at line 86 of file qnativesocketengine_p_p.h.

Constructor & Destructor Documentation

◆ QNativeSocketEnginePrivate()

QNativeSocketEnginePrivate::QNativeSocketEnginePrivate ( )

Constructs the private class and initializes all data members.

Definition at line 158 of file qnativesocketengine.cpp.

References QSysInfo::machineHostName().

+ Here is the call graph for this function:

◆ ~QNativeSocketEnginePrivate()

QNativeSocketEnginePrivate::~QNativeSocketEnginePrivate ( )

Destructs the private class.

Definition at line 172 of file qnativesocketengine.cpp.

Member Function Documentation

◆ adjustAddressProtocol()

QHostAddress QNativeSocketEnginePrivate::adjustAddressProtocol ( const QHostAddress & address) const

Adjusts the incoming address family to match the currently bound address (if any). This function will convert v4-mapped IPv6 addresses to IPv4 and vice-versa. All other address types and values will be left unchanged.

Definition at line 298 of file qnativesocketengine.cpp.

References QAbstractSocket::AnyIPProtocol, QAbstractSocket::IPv4Protocol, QAbstractSocket::IPv6Protocol, Q_LIKELY, QAbstractSocketEnginePrivate::socketProtocol, and QAbstractSocket::UnknownNetworkLayerProtocol.

◆ checkProxy()

◆ createNewSocket()

bool QNativeSocketEnginePrivate::createNewSocket ( QAbstractSocket::SocketType socketType,
QAbstractSocket::NetworkLayerProtocol & socketProtocol )

◆ fetchConnectionParameters()

◆ nativeAccept()

◆ nativeBind()

◆ nativeBytesAvailable()

qint64 QNativeSocketEnginePrivate::nativeBytesAvailable ( ) const

Definition at line 769 of file qnativesocketengine_unix.cpp.

References qDebug, qt_safe_ioctl(), socketDescriptor, QAbstractSocketEnginePrivate::socketType, and QAbstractSocket::UdpSocket.

+ Here is the call graph for this function:

◆ nativeClose()

void QNativeSocketEnginePrivate::nativeClose ( )

Definition at line 1255 of file qnativesocketengine_unix.cpp.

References qDebug, qt_safe_close(), and socketDescriptor.

+ Here is the call graph for this function:

◆ nativeConnect()

◆ nativeHasPendingDatagrams()

bool QNativeSocketEnginePrivate::nativeHasPendingDatagrams ( ) const

Definition at line 792 of file qnativesocketengine_unix.cpp.

References qDebug, QT_EINTR_LOOP, and socketDescriptor.

◆ nativeJoinMulticastGroup()

bool QNativeSocketEnginePrivate::nativeJoinMulticastGroup ( const QHostAddress & groupAddress,
const QNetworkInterface & iface )

Definition at line 686 of file qnativesocketengine_unix.cpp.

References interface, and multicastMembershipHelper().

+ Here is the call graph for this function:

◆ nativeLeaveMulticastGroup()

bool QNativeSocketEnginePrivate::nativeLeaveMulticastGroup ( const QHostAddress & groupAddress,
const QNetworkInterface & iface )

Definition at line 696 of file qnativesocketengine_unix.cpp.

References interface, and multicastMembershipHelper().

+ Here is the call graph for this function:

◆ nativeListen()

bool QNativeSocketEnginePrivate::nativeListen ( int backlog)

Definition at line 527 of file qnativesocketengine_unix.cpp.

References QAbstractSocket::AddressInUseError, QAbstractSocket::ListeningState, PortInuseErrorString, qDebug, qt_safe_listen(), setError(), socketDescriptor, and QAbstractSocketEnginePrivate::socketState.

+ Here is the call graph for this function:

◆ nativeMulticastInterface()

QNetworkInterface QNativeSocketEnginePrivate::nativeMulticastInterface ( ) const

Definition at line 706 of file qnativesocketengine_unix.cpp.

References QNetworkInterface::allInterfaces(), QAbstractSocket::AnyIPProtocol, i, QNetworkInterface::interfaceFromIndex(), QAbstractSocket::IPv6Protocol, j, QT_SOCKOPTLEN_T, socketDescriptor, and QAbstractSocketEnginePrivate::socketProtocol.

+ Here is the call graph for this function:

◆ nativePendingDatagramSize()

qint64 QNativeSocketEnginePrivate::nativePendingDatagramSize ( ) const

Definition at line 810 of file qnativesocketengine_unix.cpp.

References qDebug, QT_EINTR_LOOP, and socketDescriptor.

◆ nativeRead()

qint64 QNativeSocketEnginePrivate::nativeRead ( char * data,
qint64 maxLength )

◆ nativeReceiveDatagram()

◆ nativeSelect() [1/2]

int QNativeSocketEnginePrivate::nativeSelect ( QDeadlineTimer deadline,
bool checkRead,
bool checkWrite,
bool * selectForRead,
bool * selectForWrite ) const

Definition at line 1359 of file qnativesocketengine_unix.cpp.

References deadline, qt_make_pollfd(), qt_safe_poll(), ret, and socketDescriptor.

+ Here is the call graph for this function:

◆ nativeSelect() [2/2]

int QNativeSocketEnginePrivate::nativeSelect ( QDeadlineTimer deadline,
bool selectForRead ) const

Definition at line 1351 of file qnativesocketengine_unix.cpp.

References deadline, and nativeSelect().

Referenced by nativeSelect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nativeSendDatagram()

qint64 QNativeSocketEnginePrivate::nativeSendDatagram ( const char * data,
qint64 length,
const QIpPacketHeader & header )

Definition at line 1006 of file qnativesocketengine_unix.cpp.

References QAbstractSocket::DatagramTooLargeError, DatagramTooLargeErrorString, header(), QAbstractSocket::NetworkError, qDebug, qt_safe_sendmsg(), QAbstractSocket::RemoteHostClosedError, RemoteHostClosedErrorString, SendDatagramErrorString, setError(), setPortAndAddress(), socketDescriptor, and QtDebugUtils::toPrintable().

+ Here is the call graph for this function:

◆ nativeSetMulticastInterface()

bool QNativeSocketEnginePrivate::nativeSetMulticastInterface ( const QNetworkInterface & iface)

Definition at line 740 of file qnativesocketengine_unix.cpp.

References QAbstractSocket::AnyIPProtocol, i, QAbstractSocket::IPv4Protocol, QAbstractSocket::IPv6Protocol, QHostAddress::protocol(), socketDescriptor, QAbstractSocketEnginePrivate::socketProtocol, and QHostAddress::toIPv4Address().

+ Here is the call graph for this function:

◆ nativeWrite()

qint64 QNativeSocketEnginePrivate::nativeWrite ( const char * data,
qint64 length )

Definition at line 1264 of file qnativesocketengine_unix.cpp.

References QAbstractSocket::DatagramTooLargeError, DatagramTooLargeErrorString, qDebug, qt_safe_write_nosignal(), QAbstractSocket::RemoteHostClosedError, RemoteHostClosedErrorString, setError(), socketDescriptor, and QtDebugUtils::toPrintable().

+ Here is the call graph for this function:

◆ option()

int QNativeSocketEnginePrivate::option ( QNativeSocketEngine::SocketOption opt) const

◆ setError()

void QNativeSocketEnginePrivate::setError ( QAbstractSocket::SocketError error,
ErrorString errorString ) const

◆ setOption()

bool QNativeSocketEnginePrivate::setOption ( QNativeSocketEngine::SocketOption opt,
int v )

◆ setPortAndAddress()

void QNativeSocketEnginePrivate::setPortAndAddress ( quint16 port,
const QHostAddress & address,
qt_sockaddr * aa,
QT_SOCKLEN_T * sockAddrSize )
inline

Sets address and port in the aa sockaddr structure and the size in sockAddrSize. The address is converted to IPv6 if the current socket protocol is also IPv6.

Definition at line 162 of file qnativesocketengine_p_p.h.

References QHostAddress::AnyIPProtocol, QHostAddress::IPv4Protocol, QHostAddress::IPv6Protocol, QAbstractSocketEnginePrivate::socketProtocol, and QHostAddress::UnknownNetworkLayerProtocol.

Referenced by nativeBind(), nativeConnect(), and nativeSendDatagram().

+ Here is the caller graph for this function:

Member Data Documentation

◆ exceptNotifier

QSocketNotifier * QNativeSocketEnginePrivate::exceptNotifier

Definition at line 80 of file qnativesocketengine_p_p.h.

◆ readNotifier

QSocketNotifier* QNativeSocketEnginePrivate::readNotifier

Definition at line 80 of file qnativesocketengine_p_p.h.

◆ socketDescriptor

◆ writeNotifier

QSocketNotifier * QNativeSocketEnginePrivate::writeNotifier

Definition at line 80 of file qnativesocketengine_p_p.h.


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