QSocketDescriptor Class

A class which holds a native socket descriptor. \internal. More...

Header: #include <QSocketDescriptor>

Public Functions

QSocketDescriptor(DescriptorType descriptor = DescriptorType(-1))
QSocketDescriptor(qintptr descriptor)
Qt::HANDLE winHandle() const

Detailed Description

\inmoduleQtCore

\ingroupnetwork \ingroup io

\since5.15

QSocketDescriptor makes it easier to handle native socket descriptors in cross-platform code.

On Windows it holds a Qt::HANDLE and on Unix it holds an int. The class will implicitly convert between the class and the native descriptor type.

Member Function Documentation

[noexcept] QSocketDescriptor::QSocketDescriptor(DescriptorType descriptor = DescriptorType(-1))

\internal

Construct a QSocketDescriptor from a native socket descriptor.

[noexcept] QSocketDescriptor::QSocketDescriptor(qintptr descriptor)

\internal

Construct a QSocketDescriptor from a native socket descriptor.

Note: This constructor is only available on Windows.

[constexpr noexcept] Qt::HANDLE QSocketDescriptor::winHandle() const

\internal

Returns the internal handle.

Note: This function is only available on Windows.