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
qnativesocketengine_win.cpp File Reference

(032ffb70a829184fb620cf14fa146580b742e0e8)

#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)   Q_UNUSED(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)   (IOC_IN|(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 )   (IOC_IN|(x)|(y))

Definition at line 253 of file qnativesocketengine_win.cpp.

◆ AF_INET6

◆ IOC_VENDOR

#define IOC_VENDOR   0x18000000

Definition at line 250 of file qnativesocketengine_win.cpp.

◆ IP_HOPLIMIT

#define IP_HOPLIMIT   21

Definition at line 34 of file qnativesocketengine_win.cpp.

Referenced by convertToLevelAndOption().

◆ IPV6_V6ONLY

◆ SIO_UDP_CONNRESET

#define SIO_UDP_CONNRESET   _WSAIOW(IOC_VENDOR,12)

Definition at line 255 of file qnativesocketengine_win.cpp.

◆ SO_EXCLUSIVEADDRUSE

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

Definition at line 105 of file qnativesocketengine_win.cpp.

Referenced by convertToLevelAndOption().

◆ WS_ERROR_DEBUG

#define WS_ERROR_DEBUG ( x)    Q_UNUSED(x)

Definition at line 96 of file qnativesocketengine_win.cpp.

Referenced by qt_socket_getType().

◆ WSA_FLAG_NO_HANDLE_INHERIT

#define WSA_FLAG_NO_HANDLE_INHERIT   0x80

Function Documentation

◆ convertToLevelAndOption()

◆ durationToTimeval()

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

Definition at line 1432 of file qnativesocketengine_win.cpp.

◆ multicastMembershipHelper()

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

◆ qt_socket_getPortAndAddress()

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

Definition at line 112 of file qnativesocketengine_win.cpp.

References AF_INET6, i, QString::number(), and QHostAddress::setAddress().

+ Here is the call graph for this function:

◆ qt_socket_getType()

static QAbstractSocket::SocketType qt_socket_getType ( qintptr socketDescriptor)
inlinestatic

◆ setErrorFromWSAError()