![]() |
Qt 6.x
The Qt SDK
|
#include <qnativesocketengine_p_p.h>
Additional Inherited Members | |
![]() | |
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) |
Definition at line 71 of file qnativesocketengine_p_p.h.
Definition at line 86 of file qnativesocketengine_p_p.h.
QNativeSocketEnginePrivate::QNativeSocketEnginePrivate | ( | ) |
Constructs the private class and initializes all data members.
Definition at line 158 of file qnativesocketengine.cpp.
References QSysInfo::machineHostName().
QNativeSocketEnginePrivate::~QNativeSocketEnginePrivate | ( | ) |
Destructs the private class.
Definition at line 172 of file qnativesocketengine.cpp.
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.
bool QNativeSocketEnginePrivate::checkProxy | ( | const QHostAddress & | address | ) |
Definition at line 323 of file qnativesocketengine.cpp.
References QList< T >::constFirst(), QNetworkProxy::DefaultProxy, InvalidProxyTypeString, QNetworkProxy::NoProxy, QObjectData::parent, QObject::parent(), proxy, QAbstractSocket::proxy(), QNetworkProxyFactory::proxyForQuery(), QNetworkProxyQuery::SctpServer, QNetworkProxyQuery::SctpSocket, QAbstractSocket::SctpSocket, server, setError(), socket, QAbstractSocket::socketType(), QNetworkProxyQuery::TcpServer, QNetworkProxyQuery::TcpSocket, QAbstractSocket::TcpSocket, QNetworkProxy::type(), QNetworkProxyQuery::UdpSocket, QAbstractSocket::UdpSocket, QAbstractSocket::UnknownSocketType, and QAbstractSocket::UnsupportedSocketOperationError.
bool QNativeSocketEnginePrivate::createNewSocket | ( | QAbstractSocket::SocketType | socketType, |
QAbstractSocket::NetworkLayerProtocol & | socketProtocol | ||
) |
Creates and returns a new socket descriptor of type socketType and socketProtocol. Returns -1 on failure.
Definition at line 190 of file qnativesocketengine_unix.cpp.
References AccessErrorString, AF_INET6, QAbstractSocket::AnyIPProtocol, QAbstractSocket::IPv4Protocol, QAbstractSocket::IPv6Protocol, ProtocolUnsupportedErrorString, qDebug, qt_safe_socket(), ResourceErrorString, QAbstractSocket::SctpSocket, setError(), socket, QAbstractSocket::SocketAccessError, socketDescriptor, QAbstractSocketEnginePrivate::socketProtocol, QAbstractSocket::SocketResourceError, QAbstractSocketEnginePrivate::socketType, QAbstractSocket::UdpSocket, and QAbstractSocket::UnsupportedSocketOperationError.
bool QNativeSocketEnginePrivate::fetchConnectionParameters | ( | ) |
Fetches information about both ends of the connection: whatever is available.
Definition at line 1142 of file qnativesocketengine_unix.cpp.
References qt_sockaddr::a, AF_INET6, QHostAddress::Any, QAbstractSocket::AnyIPProtocol, QHostAddress::AnyIPv4, QHostAddress::AnyIPv6, QHostAddress::clear(), connected, QByteArray::constData(), QAbstractSocketEnginePrivate::inboundStreamCount, InvalidSocketErrorString, QAbstractSocket::IPv4Protocol, IPV6_V6ONLY, QAbstractSocket::IPv6Protocol, QAbstractSocketEnginePrivate::localAddress, QAbstractSocketEnginePrivate::localPort, QAbstractSocketEngine::MaxStreamsSocketOption, QAbstractSocketEnginePrivate::outboundStreamCount, QAbstractSocketEnginePrivate::peerAddress, QAbstractSocketEnginePrivate::peerPort, qDebug, QStringLiteral, qt_socket_getPortAndAddress(), QT_SOCKOPTLEN_T, qWarning, QAbstractSocket::SctpSocket, setError(), socketDescriptor, QAbstractSocketEnginePrivate::socketProtocol, QAbstractSocketEnginePrivate::socketType, QAbstractSocket::TcpSocket, QString::toLatin1(), QHostAddress::toString(), QAbstractSocket::UdpSocket, QAbstractSocket::UnknownNetworkLayerProtocol, QAbstractSocket::UnknownSocketType, and QAbstractSocket::UnsupportedSocketOperationError.
qintptr QNativeSocketEnginePrivate::nativeAccept | ( | ) |
Definition at line 566 of file qnativesocketengine_unix.cpp.
References AccessErrorString, InvalidSocketErrorString, QAbstractSocket::NetworkError, NotSocketErrorString, ProtocolUnsupportedErrorString, qt_safe_accept(), RemoteHostClosedErrorString, ResourceErrorString, setError(), QAbstractSocket::SocketAccessError, socketDescriptor, QAbstractSocket::SocketResourceError, QAbstractSocket::TemporaryError, TemporaryErrorString, QAbstractSocket::UnknownSocketError, UnknownSocketErrorString, and QAbstractSocket::UnsupportedSocketOperationError.
bool QNativeSocketEnginePrivate::nativeBind | ( | const QHostAddress & | address, |
quint16 | port | ||
) |
Definition at line 473 of file qnativesocketengine_unix.cpp.
References qt_sockaddr::a, qt_sockaddr::a4, QAbstractSocket::AddressInUseError, AddressInuseErrorString, AddressNotAvailableErrorString, AddressProtectedErrorString, AF_INET6, QAbstractSocket::AnyIPProtocol, QAbstractSocket::BoundState, IPV6_V6ONLY, QAbstractSocket::IPv6Protocol, OperationUnsupportedErrorString, qDebug, setError(), setPortAndAddress(), QAbstractSocket::SocketAccessError, QAbstractSocket::SocketAddressNotAvailableError, socketDescriptor, QAbstractSocketEnginePrivate::socketState, and QAbstractSocket::UnsupportedSocketOperationError.
qint64 QNativeSocketEnginePrivate::nativeBytesAvailable | ( | ) | const |
Definition at line 778 of file qnativesocketengine_unix.cpp.
References qDebug, qt_safe_ioctl(), socketDescriptor, QAbstractSocketEnginePrivate::socketType, and QAbstractSocket::UdpSocket.
void QNativeSocketEnginePrivate::nativeClose | ( | ) |
Definition at line 1264 of file qnativesocketengine_unix.cpp.
References qDebug, qt_safe_close(), and socketDescriptor.
bool QNativeSocketEnginePrivate::nativeConnect | ( | const QHostAddress & | address, |
quint16 | port | ||
) |
Definition at line 393 of file qnativesocketengine_unix.cpp.
References qt_sockaddr::a, AccessErrorString, AddressInuseErrorString, QAbstractSocket::ConnectedState, QAbstractSocket::ConnectingState, QAbstractSocket::ConnectionRefusedError, ConnectionRefusedErrorString, ConnectionTimeOutErrorString, HostUnreachableErrorString, InvalidSocketErrorString, QAbstractSocket::NetworkError, NetworkUnreachableErrorString, qDebug, qt_safe_connect(), setError(), setPortAndAddress(), QAbstractSocket::SocketAccessError, socketDescriptor, QAbstractSocketEnginePrivate::socketState, QAbstractSocket::UnconnectedState, and QAbstractSocket::UnfinishedSocketOperationError.
bool QNativeSocketEnginePrivate::nativeHasPendingDatagrams | ( | ) | const |
Definition at line 801 of file qnativesocketengine_unix.cpp.
References EINTR_LOOP, qDebug, and socketDescriptor.
bool QNativeSocketEnginePrivate::nativeJoinMulticastGroup | ( | const QHostAddress & | groupAddress, |
const QNetworkInterface & | iface | ||
) |
Definition at line 695 of file qnativesocketengine_unix.cpp.
References interface, and multicastMembershipHelper().
bool QNativeSocketEnginePrivate::nativeLeaveMulticastGroup | ( | const QHostAddress & | groupAddress, |
const QNetworkInterface & | iface | ||
) |
Definition at line 705 of file qnativesocketengine_unix.cpp.
References interface, and multicastMembershipHelper().
bool QNativeSocketEnginePrivate::nativeListen | ( | int | backlog | ) |
Definition at line 536 of file qnativesocketengine_unix.cpp.
References QAbstractSocket::AddressInUseError, QAbstractSocket::ListeningState, PortInuseErrorString, qDebug, qt_safe_listen(), setError(), socketDescriptor, and QAbstractSocketEnginePrivate::socketState.
QNetworkInterface QNativeSocketEnginePrivate::nativeMulticastInterface | ( | ) | const |
Definition at line 715 of file qnativesocketengine_unix.cpp.
References QNetworkInterface::allInterfaces(), QAbstractSocket::AnyIPProtocol, QList< T >::at(), i, QNetworkInterface::interfaceFromIndex(), QAbstractSocket::IPv6Protocol, j, QT_SOCKOPTLEN_T, QList< T >::size(), socketDescriptor, and QAbstractSocketEnginePrivate::socketProtocol.
qint64 QNativeSocketEnginePrivate::nativePendingDatagramSize | ( | ) | const |
Definition at line 819 of file qnativesocketengine_unix.cpp.
References EINTR_LOOP, qDebug, and socketDescriptor.
Definition at line 1308 of file qnativesocketengine_unix.cpp.
References QAbstractSocketEnginePrivate::hasSetSocketError, QAbstractSocket::NetworkError, qDebug, qt_error_string(), qt_safe_read(), qWarning, socketDescriptor, QAbstractSocketEnginePrivate::socketError, QAbstractSocketEnginePrivate::socketErrorString, QAbstractSocket::SocketTimeoutError, and QtDebugUtils::toPrintable().
qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram | ( | char * | data, |
qint64 | maxLength, | ||
QIpPacketHeader * | header, | ||
QAbstractSocketEngine::PacketHeaderOptions | options | ||
) |
Definition at line 879 of file qnativesocketengine_unix.cpp.
References QString::clear(), QAbstractSocket::ConnectionRefusedError, ConnectionRefusedErrorString, QByteArray::constData(), header(), info, QAbstractSocketEnginePrivate::localPort, QAbstractSocket::NetworkError, QString::number(), Q_ASSERT, Q_INT64_C, qDebug, qt_socket_getPortAndAddress(), QT_WARNING_DISABLE_CLANG, QT_WARNING_POP, QT_WARNING_PUSH, ReceiveDatagramErrorString, setError(), socketDescriptor, QString::toLatin1(), QtDebugUtils::toPrintable(), QAbstractSocketEngine::WantDatagramDestination, QAbstractSocketEngine::WantDatagramHopLimit, QAbstractSocketEngine::WantDatagramSender, QAbstractSocketEngine::WantNone, and QAbstractSocketEngine::WantStreamNumber.
int QNativeSocketEnginePrivate::nativeSelect | ( | int | timeout, |
bool | checkRead, | ||
bool | checkWrite, | ||
bool * | selectForRead, | ||
bool * | selectForWrite | ||
) | const |
Definition at line 1365 of file qnativesocketengine_unix.cpp.
References qt_make_pollfd(), qt_poll_msecs(), ret, and socketDescriptor.
int QNativeSocketEnginePrivate::nativeSelect | ( | int | timeout, |
bool | selectForRead | ||
) | const |
Definition at line 1357 of file qnativesocketengine_unix.cpp.
References nativeSelect().
Referenced by nativeSelect().
qint64 QNativeSocketEnginePrivate::nativeSendDatagram | ( | const char * | data, |
qint64 | length, | ||
const QIpPacketHeader & | header | ||
) |
Definition at line 1015 of file qnativesocketengine_unix.cpp.
References QByteArray::constData(), QAbstractSocket::DatagramTooLargeError, DatagramTooLargeErrorString, header(), QString::isNull(), QAbstractSocket::NetworkError, qDebug, qt_safe_sendmsg(), QAbstractSocket::RemoteHostClosedError, RemoteHostClosedErrorString, SendDatagramErrorString, setError(), setPortAndAddress(), socketDescriptor, QString::toLatin1(), and QtDebugUtils::toPrintable().
bool QNativeSocketEnginePrivate::nativeSetMulticastInterface | ( | const QNetworkInterface & | iface | ) |
Definition at line 749 of file qnativesocketengine_unix.cpp.
References QAbstractSocket::AnyIPProtocol, QList< T >::at(), i, QAbstractSocket::IPv4Protocol, QAbstractSocket::IPv6Protocol, QHostAddress::protocol(), QList< T >::size(), socketDescriptor, QAbstractSocketEnginePrivate::socketProtocol, and QHostAddress::toIPv4Address().
Definition at line 1273 of file qnativesocketengine_unix.cpp.
References QAbstractSocket::DatagramTooLargeError, DatagramTooLargeErrorString, qDebug, qt_safe_write_nosignal(), QAbstractSocket::RemoteHostClosedError, RemoteHostClosedErrorString, setError(), socketDescriptor, and QtDebugUtils::toPrintable().
int QNativeSocketEnginePrivate::option | ( | QNativeSocketEngine::SocketOption | opt | ) | const |
Returns the value of the socket option opt.
Definition at line 262 of file qnativesocketengine_unix.cpp.
References QAbstractSocketEngine::BindExclusively, QAbstractSocketEngine::BroadcastSocketOption, convertToLevelAndOption(), QAbstractSocket::IPv6Protocol, QAbstractSocketEngine::MaxStreamsSocketOption, QAbstractSocketEngine::NonBlockingSocketOption, opt, QAbstractSocketEngine::PathMtuInformation, qMin(), QT_SOCKOPTLEN_T, socketDescriptor, and QAbstractSocketEnginePrivate::socketProtocol.
void QNativeSocketEnginePrivate::setError | ( | QAbstractSocket::SocketError | error, |
ErrorString | errorString | ||
) | const |
Sets the error and error string if not set already. The only interesting error is the first one that occurred, and not the last one.
Definition at line 182 of file qnativesocketengine.cpp.
References AccessErrorString, AddressInuseErrorString, AddressNotAvailableErrorString, AddressProtectedErrorString, BroadcastingInitFailedErrorString, ConnectionRefusedErrorString, ConnectionResetErrorString, ConnectionTimeOutErrorString, DatagramTooLargeErrorString, error, QAbstractSocketEnginePrivate::hasSetSocketError, HostUnreachableErrorString, InvalidProxyTypeString, InvalidSocketErrorString, NetworkDroppedConnectionErrorString, NetworkUnreachableErrorString, NoIpV6ErrorString, NonBlockingInitFailedErrorString, NotSocketErrorString, OperationUnsupportedErrorString, PortInuseErrorString, ProtocolUnsupportedErrorString, ReadErrorString, ReceiveDatagramErrorString, RemoteHostClosedErrorString, ResourceErrorString, SendDatagramErrorString, QAbstractSocketEnginePrivate::socketError, QAbstractSocketEnginePrivate::socketErrorString, TemporaryErrorString, TimeOutErrorString, UnknownSocketErrorString, and WriteErrorString.
Referenced by checkProxy(), createNewSocket(), fetchConnectionParameters(), nativeAccept(), nativeBind(), nativeConnect(), nativeListen(), nativeReceiveDatagram(), nativeSendDatagram(), and nativeWrite().
bool QNativeSocketEnginePrivate::setOption | ( | QNativeSocketEngine::SocketOption | opt, |
int | v | ||
) |
Sets the socket option opt to v.
Definition at line 318 of file qnativesocketengine_unix.cpp.
References QAbstractSocketEngine::AddressReusable, QAbstractSocketEngine::BindExclusively, convertToLevelAndOption(), QAbstractSocketEngine::MaxStreamsSocketOption, QAbstractSocketEngine::NonBlockingSocketOption, opt, qt_safe_ioctl(), QT_SOCKOPTLEN_T, socketDescriptor, QAbstractSocketEnginePrivate::socketProtocol, QAbstractSocketEnginePrivate::socketType, and QAbstractSocket::UdpSocket.
|
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 qt_sockaddr::a, qt_sockaddr::a4, qt_sockaddr::a6, QHostAddress::AnyIPProtocol, QHostAddress::IPv4Protocol, QHostAddress::IPv6Protocol, QAbstractSocketEnginePrivate::socketProtocol, and QHostAddress::UnknownNetworkLayerProtocol.
Referenced by nativeBind(), nativeConnect(), and nativeSendDatagram().
QSocketNotifier * QNativeSocketEnginePrivate::exceptNotifier |
Definition at line 80 of file qnativesocketengine_p_p.h.
QSocketNotifier* QNativeSocketEnginePrivate::readNotifier |
Definition at line 80 of file qnativesocketengine_p_p.h.
qintptr QNativeSocketEnginePrivate::socketDescriptor |
Definition at line 78 of file qnativesocketengine_p_p.h.
Referenced by createNewSocket(), fetchConnectionParameters(), nativeAccept(), nativeBind(), nativeBytesAvailable(), nativeClose(), nativeConnect(), nativeHasPendingDatagrams(), nativeListen(), nativeMulticastInterface(), nativePendingDatagramSize(), nativeRead(), nativeReceiveDatagram(), nativeSelect(), nativeSendDatagram(), nativeSetMulticastInterface(), nativeWrite(), option(), and setOption().
QSocketNotifier * QNativeSocketEnginePrivate::writeNotifier |
Definition at line 80 of file qnativesocketengine_p_p.h.