6#ifndef QNATIVESOCKETENGINE_P_P_H
7#define QNATIVESOCKETENGINE_P_P_H
20#include "private/qabstractsocketengine_p.h"
21#include "private/qnativesocketengine_p.h"
24# include <netinet/in.h>
39# ifndef WSAID_WSARECVMSG
40typedef INT (WINAPI *LPFN_WSARECVMSG)(SOCKET s, LPWSAMSG lpMsg,
41 LPDWORD lpdwNumberOfBytesRecvd,
42 LPWSAOVERLAPPED lpOverlapped,
43 LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
44# define WSAID_WSARECVMSG {0xf689d7c8
,0x6f1f
,0x436b
,{0x8a
,0x53
,0xe5
,0x4f
,0xe3
,0x51
,0xc3
,0x22
}}
46# ifndef WSAID_WSASENDMSG
50 LPDWORD lpNumberOfBytesSent;
51 LPWSAOVERLAPPED lpOverlapped;
52 LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine;
53} WSASENDMSG, *LPWSASENDMSG;
55typedef INT (WSAAPI *LPFN_WSASENDMSG)(SOCKET s, LPWSAMSG lpMsg, DWORD dwFlags,
56 LPDWORD lpNumberOfBytesSent,
57 LPWSAOVERLAPPED lpOverlapped,
58 LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
60# define WSAID_WSASENDMSG {0xa441e712
,0x754f
,0x43ca
,{0x84
,0xa7
,0x0d
,0xee
,0x44
,0xcf
,0x60
,0x6d
}}
74 Q_DECLARE_PUBLIC(QNativeSocketEngine)
124 int option(QNativeSocketEngine::SocketOption option)
const;
125 bool setOption(QNativeSocketEngine::SocketOption option,
int value);
127 bool createNewSocket(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol &protocol);
129 bool nativeConnect(
const QHostAddress &address, quint16 port);
130 bool nativeBind(
const QHostAddress &address, quint16 port);
133#ifndef QT_NO_NETWORKINTERFACE
135 const QNetworkInterface &iface);
137 const QNetworkInterface &iface);
146 QAbstractSocketEngine::PacketHeaderOptions options);
150 int nativeSelect(QDeadlineTimer deadline,
bool selectForRead)
const;
151 int nativeSelect(QDeadlineTimer deadline,
bool checkRead,
bool checkWrite,
152 bool *selectForRead,
bool *selectForWrite)
const;
160
161
162
163 void setPortAndAddress(quint16 port,
const QHostAddress &address, qt_sockaddr *aa, QT_SOCKLEN_T *sockAddrSize)
165 switch (socketProtocol) {
166 case QHostAddress::IPv6Protocol:
167 case QHostAddress::AnyIPProtocol:
169 setSockaddr(&aa->a6, address, port);
170 *sockAddrSize =
sizeof(sockaddr_in6);
173 case QHostAddress::IPv4Protocol:
175 setSockaddr(&aa->a4, address, port);
176 *sockAddrSize =
sizeof(sockaddr_in);
179 case QHostAddress::UnknownNetworkLayerProtocol:
183 *sockAddrSize = setSockaddr(&aa->a, address, port);
bool event(QEvent *) override
This virtual function receives events to an object and should return true if the event e was recogniz...
QExceptionNotifier(qintptr fd, QNativeSocketEngine *parent)
QNativeSocketEngine * engine
bool nativeHasPendingDatagrams() const
bool createNewSocket(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol &protocol)
QNetworkInterface nativeMulticastInterface() const
qint64 nativeBytesAvailable() const
QSocketNotifier * readNotifier
qint64 nativeWrite(const char *data, qint64 length)
~QNativeSocketEnginePrivate()
int option(QNativeSocketEngine::SocketOption option) const
bool nativeJoinMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface)
bool setOption(QNativeSocketEngine::SocketOption option, int value)
int nativeSelect(QDeadlineTimer deadline, bool selectForRead) const
void setError(QAbstractSocket::SocketError error, ErrorString errorString) const
bool nativeSetMulticastInterface(const QNetworkInterface &iface)
bool checkProxy(const QHostAddress &address)
bool fetchConnectionParameters()
Fetches information about both ends of the connection: whatever is available.
bool nativeBind(const QHostAddress &address, quint16 port)
qint64 nativePendingDatagramSize() const
bool nativeListen(int backlog)
qint64 nativeSendDatagram(const char *data, qint64 length, const QIpPacketHeader &header)
bool nativeConnect(const QHostAddress &address, quint16 port)
QSocketNotifier * writeNotifier
int nativeSelect(QDeadlineTimer deadline, bool checkRead, bool checkWrite, bool *selectForRead, bool *selectForWrite) const
void setPortAndAddress(quint16 port, const QHostAddress &address, qt_sockaddr *aa, QT_SOCKLEN_T *sockAddrSize)
bool nativeLeaveMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface)
QHostAddress adjustAddressProtocol(const QHostAddress &address) const
QSocketNotifier * exceptNotifier
qint64 nativeRead(char *data, qint64 maxLength)
qint64 nativeReceiveDatagram(char *data, qint64 maxLength, QIpPacketHeader *header, QAbstractSocketEngine::PacketHeaderOptions options)
@ NetworkUnreachableErrorString
@ DatagramTooLargeErrorString
@ HostUnreachableErrorString
@ AddressProtectedErrorString
@ OperationUnsupportedErrorString
@ NetworkDroppedConnectionErrorString
@ ConnectionResetErrorString
@ ReceiveDatagramErrorString
@ AddressNotAvailableErrorString
@ NonBlockingInitFailedErrorString
@ RemoteHostClosedErrorString
@ InvalidSocketErrorString
@ ConnectionTimeOutErrorString
@ ConnectionRefusedErrorString
@ AddressInuseErrorString
@ ProtocolUnsupportedErrorString
@ SendDatagramErrorString
@ UnknownSocketErrorString
@ BroadcastingInitFailedErrorString
The QNetworkProxyQuery class is used to query the proxy settings for a socket.
QNativeSocketEngine * engine
bool event(QEvent *) override
This virtual function receives events to an object and should return true if the event e was recogniz...
QReadNotifier(qintptr fd, QNativeSocketEngine *parent)
QWriteNotifier(qintptr fd, QNativeSocketEngine *parent)
QNativeSocketEngine * engine
bool event(QEvent *) override
\reimp
#define Q_CHECK_STATES3(function, state1, state2, state3, returnValue)
#define Q_CHECK_STATES(function, state1, state2, returnValue)
#define Q_CHECK_TYPES(function, type1, type2, returnValue)
#define Q_CHECK_VALID_SOCKETLAYER(function, returnValue)
#define Q_CHECK_NOT_STATE(function, checkState, returnValue)
#define Q_CHECK_TYPE(function, type, returnValue)
#define Q_CHECK_STATE(function, checkState, returnValue)