IpSocketBase class
An IPv4 or IPv6 socket with the IP options of that version.
On this page
- Names
- Constructors
- IpSocketBase
- Methods
- operator=
- SetOptionAddMembership
- SetOptionDropMembership
- SetOptionHeaderInclude
- GetOptionHeaderInclude
- SetOptionMulticastLoop
- GetOptionMulticastLoop
- SetOptionPacketInformation
- GetOptionPacketInformation
- SetOptionHopLimit
- GetOptionHopLimit
- SetOptionMulticastInterface
- GetOptionMulticastInterface
- SetOptionOriginalArrivalInterface
- GetOptionOriginalArrivalInterface
- SetOptionRecvInterface
- GetOptionRecvInterface
- SetOptionUnicastInterface
- GetOptionUnicastInterface
- SetOptionAddSourceMembership
- SetOptionDropSourceMembership
- SetOptionBlockSource
- SetOptionUnblockSource
- SetOptionMulticastTtl
- GetOptionMulticastTtl
- SetOptionTypeOfService
- GetOptionTypeOfService
- SetOptionTtl
- GetOptionTtl
- SetOptionDontFragment
- GetOptionDontFragment
- SetOptionOptions
- GetOptionOptions
- SetOptionReceiveBroadcast
- GetOptionReceiveBroadcast
- SetOptionWfpRedirectContext
- GetOptionWfpRedirectContext
- SetOptionWfpRedirectRecords
- GetOptionWfpRedirectRecords
- FillAddress
- SetOptionUnicastHops
- GetOptionUnicastHops
- SetOptionMulticastHops
- GetOptionMulticastHops
- SetOptionIpv6Only
- GetOptionIpv6Only
- SetOptionProtectionLevel
- GetOptionProtectionLevel
- Use
import ThinkMeta.ConcurrentTasks.Net.IpSocket;- Namespace
ThinkMeta::ConcurrentTasks::Net- Platforms
- Windows, Linux
Syntax
template <IpVersionType _IpVersion, SocketType _BaseSocket> class IpSocketBaseTemplate parameters
_IpVersionIpVersionType- The IP version:
IpVersion::V4orIpVersion::V6. _BaseSocketSocketType- The socket class built on:
Platform::Socket(blocking calls) orAsyncIo::AsyncSocket.
Remarks
Plain (Platform::Socket) or asynchronous (AsyncIo::AsyncSocket). Owns its socket like Socket.
See also
IpSocket, AsyncIo::AsyncIpSocket
Names
| Name | Description |
|---|---|
IpSocket |
A blocking (plain Platform::Socket) IP socket of the given version.
|
IpSocket4 |
A blocking IPv4 socket. |
IpSocket6 |
A blocking IPv6 socket. |
Constructors
IpSocketBase
Takes over other's socket; other is left without one.
Syntax
IpSocketBase(IpSocketBase&& other) noexcept = default;Parameters
otherIpSocketBase&&- The object whose socket is taken over; it holds no socket afterwards.
Methods
operator=
Takes over other's socket; a socket this object already holds is closed first.
Syntax
IpSocketBase& operator=(IpSocketBase&& other) noexcept = default;Parameters
otherIpSocketBase&&- The object whose socket is taken over; it holds no socket afterwards.
Return value
Type: IpSocketBase&
This object.
SetOptionAddMembership
Joins a multicast group (IP_ADD_MEMBERSHIP / IPV6_ADD_MEMBERSHIP).
Syntax
SocketErrorCode SetOptionAddMembership(
const typename _Traits::MulticastGroupInfo& mgi
) noexcept;Parameters
mgiconst typename _Traits::MulticastGroupInfo&- The multicast group and the local interface (
ip_mreqfor IPv4,ipv6_mreqfor IPv6).
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
See also
Windows only
Joins an IPv4 multicast group on an interface. Windows.
Syntax
SocketErrorCode SetOptionAddMembership(
const in_addr& multicastAddress,
std::uint32_t index
) noexcept;Parameters
multicastAddressconst in_addr&- The IPv4 multicast group address.
indexstd::uint32_t- The interface index (below 2^24, see remarks).
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
Remarks
The index is passed as interface address 0.x.y.z, which Windows reads as an interface index.
See also
Windows only
Joins an IPv6 multicast group on an interface. Windows.
Syntax
SocketErrorCode SetOptionAddMembership(
const in6_addr& multicastAddress,
std::uint32_t index
) noexcept;Parameters
multicastAddressconst in6_addr&- The IPv6 multicast group address.
indexstd::uint32_t- The interface index;
0selects the default interface.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
See also
SetOptionDropMembership
Leaves a multicast group (IP_DROP_MEMBERSHIP / IPV6_DROP_MEMBERSHIP).
Syntax
SocketErrorCode SetOptionDropMembership(
const typename _Traits::MulticastGroupInfo& mgi
) noexcept;Parameters
mgiconst typename _Traits::MulticastGroupInfo&- The multicast group and the local interface (
ip_mreqfor IPv4,ipv6_mreqfor IPv6), as joined.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
See also
Windows only
Leaves an IPv4 multicast group joined by interface index. Windows.
Syntax
SocketErrorCode SetOptionDropMembership(
const in_addr& multicastAddress,
std::uint32_t index
) noexcept;Parameters
multicastAddressconst in_addr&- The IPv4 multicast group address, as joined.
indexstd::uint32_t- The interface index, as joined.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
See also
Windows only
Leaves an IPv6 multicast group joined by interface index. Windows.
Syntax
SocketErrorCode SetOptionDropMembership(
const in6_addr& multicastAddress,
std::uint32_t index
) noexcept;Parameters
multicastAddressconst in6_addr&- The IPv6 multicast group address, as joined.
indexstd::uint32_t- The interface index, as joined.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
See also
SetOptionHeaderInclude
Sets whether the application supplies the IP header (IP_HDRINCL / IPV6_HDRINCL).
Syntax
SocketErrorCode SetOptionHeaderInclude(bool include) noexcept;Parameters
includebooltrueif the data sent starts with the IP header,falseif the stack adds it.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
Remarks
For raw sockets.
GetOptionHeaderInclude
Gets the header-include setting.
Syntax
SocketErrorCode GetOptionHeaderInclude(bool* include) noexcept;Parameters
includebool*- Required. Receives
trueif the application supplies the IP header.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionMulticastLoop
Sets multicast loopback (IP_MULTICAST_LOOP / IPV6_MULTICAST_LOOP).
Syntax
SocketErrorCode SetOptionMulticastLoop(bool enable) noexcept;Parameters
enablebooltrueif multicast sent is looped back to the local host,falseotherwise.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionMulticastLoop
Gets the multicast loopback setting.
Syntax
SocketErrorCode GetOptionMulticastLoop(bool* enable) noexcept;Parameters
enablebool*- Required. Receives
trueif multicast sent is looped back to the local host.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionPacketInformation
Enables packet information (IP_PKTINFO / IPV6_PKTINFO, IPV6_RECVPKTINFO on Linux).
Syntax
SocketErrorCode SetOptionPacketInformation(bool enable) noexcept;Parameters
enablebooltrueto report packet information,falseto stop it.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
Remarks
Reported in received control data; use with AsyncIo::AsyncSocket::RecvMsg.
GetOptionPacketInformation
Gets the packet-information setting.
Syntax
SocketErrorCode GetOptionPacketInformation(bool* enable) noexcept;Parameters
enablebool*- Required. Receives
trueif packet information is reported.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionHopLimitWindows only
Sets whether the hop limit of received packets is reported (IP_HOPLIMIT/IPV6_HOPLIMIT). Windows.
Syntax
SocketErrorCode SetOptionHopLimit(bool enable) noexcept;Parameters
enablebooltrueto report the hop limit (TTL) in the control data,falseto stop it.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionHopLimitWindows only
Gets whether the hop limit of received packets is reported. Windows.
Syntax
SocketErrorCode GetOptionHopLimit(bool* enable) noexcept;Parameters
enablebool*- Required. Receives
trueif the hop limit is reported.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionMulticastInterfaceWindows only
Sets the outgoing multicast interface (IP_MULTICAST_IF / IPV6_MULTICAST_IF). Windows.
Syntax
SocketErrorCode SetOptionMulticastInterface(std::uint32_t index) noexcept;Parameters
indexstd::uint32_t- The interface index, in host byte order;
0selects the default interface.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionMulticastInterfaceWindows only
Gets the outgoing multicast interface index. Windows.
Syntax
SocketErrorCode GetOptionMulticastInterface(std::uint32_t* index) noexcept;Parameters
indexstd::uint32_t*- Required. Receives the interface index, in host byte order.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionOriginalArrivalInterfaceWindows only
Enables reporting the original arrival interface (IP_ORIGINAL_ARRIVAL_IF). Windows.
Syntax
SocketErrorCode SetOptionOriginalArrivalInterface(bool enable) noexcept;Parameters
enablebooltrueto report the original arrival interface,falseto stop it.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
Remarks
Reported in received control data. Uses the IPv4 option number at the version's option level, also for IPv6.
GetOptionOriginalArrivalInterfaceWindows only
Gets the original-arrival-interface setting. Windows.
Syntax
SocketErrorCode GetOptionOriginalArrivalInterface(bool* enable) noexcept;Parameters
enablebool*- Required. Receives
trueif the original arrival interface is reported.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionRecvInterfaceWindows only
Enables reporting the receiving interface (IP_RECVIF / IPV6_RECVIF). Windows.
Syntax
SocketErrorCode SetOptionRecvInterface(bool enable) noexcept;Parameters
enablebooltrue:WSARecvMsgreturns the interface a datagram arrived on in its control data. Datagram and raw sockets only.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionRecvInterfaceWindows only
Gets whether the receiving interface is reported (IP_RECVIF / IPV6_RECVIF). Windows.
Syntax
SocketErrorCode GetOptionRecvInterface(bool* enable) noexcept;Parameters
enablebool*- Required. Receives
trueif the receiving interface is reported.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionUnicastInterfaceWindows only
Sets the outgoing unicast interface (IP_UNICAST_IF / IPV6_UNICAST_IF). Windows.
Syntax
SocketErrorCode SetOptionUnicastInterface(std::uint32_t index) noexcept;Parameters
indexstd::uint32_t- The interface index, in host byte order;
0selects the default interface.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionUnicastInterfaceWindows only
Gets the outgoing unicast interface index. Windows.
Syntax
SocketErrorCode GetOptionUnicastInterface(std::uint32_t* index) noexcept;Parameters
indexstd::uint32_t*- Required. Receives the interface index, in host byte order.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionAddSourceMembership
Joins a source-specific multicast group (IP_ADD_SOURCE_MEMBERSHIP).
Syntax
SocketErrorCode SetOptionAddSourceMembership(const ip_mreq_source& mgi) noexcept;Parameters
mgiconst ip_mreq_source&- The multicast group, the source address to receive from and the local interface.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
See also
SetOptionDropSourceMembership
Leaves a source-specific multicast group (IP_DROP_SOURCE_MEMBERSHIP).
Syntax
SocketErrorCode SetOptionDropSourceMembership(const ip_mreq_source& mgi) noexcept;Parameters
mgiconst ip_mreq_source&- The multicast group, the source address and the local interface, as joined.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
See also
SetOptionBlockSource
Blocks a multicast source (IP_BLOCK_SOURCE).
Syntax
SocketErrorCode SetOptionBlockSource(const ip_mreq_source& mgi) noexcept;Parameters
mgiconst ip_mreq_source&- The joined multicast group, the source address to block and the local interface.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
See also
SetOptionUnblockSource
Unblocks a multicast source (IP_UNBLOCK_SOURCE).
Syntax
SocketErrorCode SetOptionUnblockSource(const ip_mreq_source& mgi) noexcept;Parameters
mgiconst ip_mreq_source&- The multicast group, the blocked source address and the local interface.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
See also
SetOptionMulticastTtl
Sets the multicast TTL (IP_MULTICAST_TTL).
Syntax
SocketErrorCode SetOptionMulticastTtl(std::uint32_t ttl) noexcept;Parameters
ttlstd::uint32_t- The time to live of outgoing multicast packets (
0to255; default1).
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionMulticastTtl
Gets the multicast TTL.
Syntax
SocketErrorCode GetOptionMulticastTtl(std::uint32_t* ttl) noexcept;Parameters
ttlstd::uint32_t*- Required. Receives the time to live of outgoing multicast packets.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionTypeOfService
Sets the type of service (IP_TOS).
Syntax
SocketErrorCode SetOptionTypeOfService(std::uint32_t typeOfService) noexcept;Parameters
typeOfServicestd::uint32_t- The type-of-service byte of outgoing packets.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionTypeOfService
Gets the type of service (IP_TOS).
Syntax
SocketErrorCode GetOptionTypeOfService(std::uint32_t* typeOfService) noexcept;Parameters
typeOfServicestd::uint32_t*- Required. Receives the type-of-service byte.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionTtl
Sets the unicast TTL (IP_TTL).
Syntax
SocketErrorCode SetOptionTtl(std::uint32_t ttl) noexcept;Parameters
ttlstd::uint32_t- The time to live of outgoing unicast packets (
1to255).
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionTtl
Gets the unicast TTL (IP_TTL).
Syntax
SocketErrorCode GetOptionTtl(std::uint32_t* ttl) noexcept;Parameters
ttlstd::uint32_t*- Required. Receives the time to live of outgoing unicast packets.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionDontFragmentWindows only
Sets the don't-fragment flag (IP_DONTFRAGMENT). Windows.
Syntax
SocketErrorCode SetOptionDontFragment(bool dontFragment) noexcept;Parameters
dontFragmentbooltrueto send packets with the don't-fragment flag set.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionDontFragmentWindows only
Gets the don't-fragment flag. Windows.
Syntax
SocketErrorCode GetOptionDontFragment(bool* dontFragment) noexcept;Parameters
dontFragmentbool*- Required. Receives
trueif packets are sent with the don't-fragment flag.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionOptionsWindows only
Sets the IP options of outgoing packets (IP_OPTIONS). Windows.
Syntax
SocketErrorCode SetOptionOptions(const char* options, int length) noexcept;Parameters
optionsconst char*- Required. The IP options as they appear in the header (at most 40 bytes).
lengthint- The size of
optionsin bytes.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionOptionsWindows only
Gets the IP options (IP_OPTIONS). Windows.
Syntax
SocketErrorCode GetOptionOptions(char* options, int* length) noexcept;Parameters
optionschar*- Required. Receives the IP options.
lengthint*- Required. In: the size of
optionsin bytes; out: the bytes written.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionReceiveBroadcastWindows only
Sets whether broadcast is received (IP_RECEIVE_BROADCAST). Windows.
Syntax
SocketErrorCode SetOptionReceiveBroadcast(bool enable) noexcept;Parameters
enablebooltrueto receive broadcast data,falseto drop it.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionReceiveBroadcastWindows only
Gets the receive-broadcast setting. Windows.
Syntax
SocketErrorCode GetOptionReceiveBroadcast(bool* enable) noexcept;Parameters
enablebool*- Required. Receives
trueif broadcast data is received.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionWfpRedirectContextWindows only
Sets the WFP redirect context (IP_WFP_REDIRECT_CONTEXT). Windows.
Syntax
SocketErrorCode SetOptionWfpRedirectContext(
const WSACMSGHDR* data,
int length
) noexcept;Parameters
dataconst WSACMSGHDR*- Required. The redirect context, as received in control data.
lengthint- The size of
datain bytes.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionWfpRedirectContextWindows only
Gets the WFP redirect context. Windows.
Syntax
SocketErrorCode GetOptionWfpRedirectContext(WSACMSGHDR* data, int* length) noexcept;Parameters
dataWSACMSGHDR*- Required. Receives the redirect context.
lengthint*- Required. In: the size of
datain bytes; out: the bytes written.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionWfpRedirectRecordsWindows only
Sets the WFP redirect records (IP_WFP_REDIRECT_RECORDS). Windows.
Syntax
SocketErrorCode SetOptionWfpRedirectRecords(
const WSACMSGHDR* data,
int length
) noexcept;Parameters
dataconst WSACMSGHDR*- Required. The redirect records, as received in control data.
lengthint- The size of
datain bytes.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionWfpRedirectRecordsWindows only
Gets the WFP redirect records. Windows.
Syntax
SocketErrorCode GetOptionWfpRedirectRecords(WSACMSGHDR* data, int* length) noexcept;Parameters
dataWSACMSGHDR*- Required. Receives the redirect records.
lengthint*- Required. In: the size of
datain bytes; out: the bytes written.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
FillAddress
Sets family, address and port of a socket address.
Syntax
static void FillAddress(
sockaddr_in& sockAddr,
const in_addr& addr,
std::uint16_t port
) noexcept;Parameters
sockAddrsockaddr_in&- The socket address to fill; zero-initialize it first.
addrconst in_addr&- The IPv4 address, e.g.
IpTraits<IpVersion::V4>::AnyAddress(INADDR_ANY) for the wildcard address. portstd::uint16_t- In host order; converted with
htons.
Remarks
Other fields are not touched: zero-initialize sockAddr first.
Sets family, address and port of a socket address.
Syntax
static void FillAddress(
sockaddr_in6& sockAddr,
const in6_addr& addr,
std::uint16_t port
) noexcept;Parameters
sockAddrsockaddr_in6&- The socket address to fill; zero-initialize it first.
addrconst in6_addr&- The IPv6 address, e.g.
IpTraits<IpVersion::V6>::AnyAddress(in6addr_any) for the wildcard address. portstd::uint16_t- In host order; converted with
htons.
Remarks
Other fields (flow info, scope id) are not touched: zero-initialize sockAddr first.
SetOptionUnicastHops
Sets the unicast hop limit (IPV6_UNICAST_HOPS).
Syntax
SocketErrorCode SetOptionUnicastHops(std::uint32_t hops) noexcept;Parameters
hopsstd::uint32_t- The hop limit of outgoing unicast packets (
0to255).
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
Remarks
The IPv6 counterpart of the IPv4 time to live.
GetOptionUnicastHops
Gets the unicast hop limit (IPV6_UNICAST_HOPS).
Syntax
SocketErrorCode GetOptionUnicastHops(std::uint32_t* hops) noexcept;Parameters
hopsstd::uint32_t*- Required. Receives the hop limit of outgoing unicast packets.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionMulticastHops
Sets the multicast hop limit (IPV6_MULTICAST_HOPS).
Syntax
SocketErrorCode SetOptionMulticastHops(std::uint32_t hops) noexcept;Parameters
hopsstd::uint32_t- The hop limit of outgoing multicast packets (
0to255; default1).
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
Remarks
The IPv6 counterpart of the IPv4 multicast time to live.
GetOptionMulticastHops
Gets the multicast hop limit (IPV6_MULTICAST_HOPS).
Syntax
SocketErrorCode GetOptionMulticastHops(std::uint32_t* hops) noexcept;Parameters
hopsstd::uint32_t*- Required. Receives the hop limit of outgoing multicast packets.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionIpv6Only
Sets whether the socket is IPv6-only (IPV6_V6ONLY).
Syntax
SocketErrorCode SetOptionIpv6Only(bool ipv6Only) noexcept;Parameters
ipv6Onlybooltrue: IPv6 only;false: allows dual-stack IPv4-mapped use.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
Remarks
Set before Platform::Socket::Bind.
GetOptionIpv6Only
Gets the IPv6-only setting.
Syntax
SocketErrorCode GetOptionIpv6Only(bool* ipv6Only) noexcept;Parameters
ipv6Onlybool*- Required. Receives
trueif the socket is IPv6-only,falseif dual-stack.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
SetOptionProtectionLevelWindows only
Sets the protection level (IPV6_PROTECTION_LEVEL, PROTECTION_LEVEL_*). Windows.
Syntax
SocketErrorCode SetOptionProtectionLevel(int level) noexcept;Parameters
levelintPROTECTION_LEVEL_UNRESTRICTED,PROTECTION_LEVEL_EDGERESTRICTEDorPROTECTION_LEVEL_RESTRICTED.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of setsockopt.
GetOptionProtectionLevelWindows only
Gets the protection level. Windows.
Syntax
SocketErrorCode GetOptionProtectionLevel(int* level) noexcept;Parameters
levelint*- Required. Receives the
PROTECTION_LEVEL_*value.
Return value
Type: SocketErrorCode
Platform::SocketError::Success, or the error of getsockopt.
Generated from ThinkMeta.ConcurrentTasks.API @ da816bc (2026-11-06).