Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qnativesocketengine_win.cpp File Reference

(83fc4ff9c20eb922113e08ba8566e077ce44dea3)

#include <winsock2.h>
#include <ws2tcpip.h>
#include "qnativesocketengine_p_p.h"
#include <qabstracteventdispatcher.h>
#include <qsocketnotifier.h>
#include <qdebug.h>
#include <qdatetime.h>
#include <qnetworkinterface.h>
#include <qoperatingsystemversion.h>
#include <qvarlengtharray.h>
#include <algorithm>
#include <chrono>
Include dependency graph for qnativesocketengine_win.cpp:

Go to the source code of this file.

Macros

#define IPV6_V6ONLY   27
#define IP_HOPLIMIT   21
#define WS_ERROR_DEBUG(x)
#define AF_INET6   23 /* Internetwork Version 6 */
#define SO_EXCLUSIVEADDRUSE   ((int)(~SO_REUSEADDR)) /* disallow local address reuse */
#define IOC_VENDOR   0x18000000
#define _WSAIOW(x, y)
#define SIO_UDP_CONNRESET   _WSAIOW(IOC_VENDOR,12)
#define WSA_FLAG_NO_HANDLE_INHERIT   0x80

Functions

static void qt_socket_getPortAndAddress (SOCKET socketDescriptor, const qt_sockaddr *sa, quint16 *port, QHostAddress *address)
static void convertToLevelAndOption (QNativeSocketEngine::SocketOption opt, QAbstractSocket::NetworkLayerProtocol socketProtocol, int &level, int &n)
static QAbstractSocket::SocketType qt_socket_getType (qintptr socketDescriptor)
static void setErrorFromWSAError (int error, QNativeSocketEnginePrivate *d)
static bool multicastMembershipHelper (QNativeSocketEnginePrivate *d, int how6, int how4, const QHostAddress &groupAddress, const QNetworkInterface &iface)
timeval durationToTimeval (std::chrono::nanoseconds dur) noexcept

Macro Definition Documentation

◆ _WSAIOW

#define _WSAIOW ( x,
y )
Value:
(IOC_IN|(x)|(y))
GLint GLint GLint GLint GLint x
GLint y

Definition at line 251 of file qnativesocketengine_win.cpp.

◆ AF_INET6

#define AF_INET6   23 /* Internetwork Version 6 */

Definition at line 102 of file qnativesocketengine_win.cpp.

◆ IOC_VENDOR

#define IOC_VENDOR   0x18000000

Definition at line 248 of file qnativesocketengine_win.cpp.

◆ IP_HOPLIMIT

#define IP_HOPLIMIT   21

Definition at line 35 of file qnativesocketengine_win.cpp.

◆ IPV6_V6ONLY

#define IPV6_V6ONLY   27

Definition at line 32 of file qnativesocketengine_win.cpp.

◆ SIO_UDP_CONNRESET

#define SIO_UDP_CONNRESET   _WSAIOW(IOC_VENDOR,12)

Definition at line 253 of file qnativesocketengine_win.cpp.

◆ SO_EXCLUSIVEADDRUSE

#define SO_EXCLUSIVEADDRUSE   ((int)(~SO_REUSEADDR)) /* disallow local address reuse */

Definition at line 106 of file qnativesocketengine_win.cpp.

◆ WS_ERROR_DEBUG

#define WS_ERROR_DEBUG ( x)
Value:
#define Q_UNUSED(x)

Definition at line 97 of file qnativesocketengine_win.cpp.

◆ WSA_FLAG_NO_HANDLE_INHERIT

#define WSA_FLAG_NO_HANDLE_INHERIT   0x80

Function Documentation

◆ convertToLevelAndOption()

void convertToLevelAndOption ( QNativeSocketEngine::SocketOption opt,
QAbstractSocket::NetworkLayerProtocol socketProtocol,
int & level,
int & n )
static

Definition at line 144 of file qnativesocketengine_win.cpp.

◆ durationToTimeval()

timeval durationToTimeval ( std::chrono::nanoseconds dur)
inlinenoexcept

Definition at line 1522 of file qnativesocketengine_win.cpp.

◆ multicastMembershipHelper()

bool multicastMembershipHelper ( QNativeSocketEnginePrivate * d,
int how6,
int how4,
const QHostAddress & groupAddress,
const QNetworkInterface & iface )
static

Definition at line 916 of file qnativesocketengine_win.cpp.

◆ qt_socket_getPortAndAddress()

void qt_socket_getPortAndAddress ( SOCKET socketDescriptor,
const qt_sockaddr * sa,
quint16 * port,
QHostAddress * address )
inlinestatic

Definition at line 113 of file qnativesocketengine_win.cpp.

◆ qt_socket_getType()

QAbstractSocket::SocketType qt_socket_getType ( qintptr socketDescriptor)
inlinestatic

Definition at line 225 of file qnativesocketengine_win.cpp.

◆ setErrorFromWSAError()

void setErrorFromWSAError ( int error,
QNativeSocketEnginePrivate * d )
static

Definition at line 620 of file qnativesocketengine_win.cpp.