xtd 0.2.0
Loading...
Searching...
No Matches

◆ dual_mode() [2/2]

socket & xtd::net::sockets::socket::dual_mode ( bool  value)

Sets a value that specifies whether the xtd::net::sockets::socket is a dual-mode socket used for both IPv4 and IPv6.

Parameters
valuetrue if the xtd::net::sockets::socket is a dual-mode socket; otherwise, false. The default is true if the socket was created by calling the xtd::net::sockets::socket(xtd::net::sockets::socket_type, xtd::net::sockets::protocol_type) constructor and the operating system supports IPv6; otherwise, the default is false.
Returns
This current instance.
Exceptions
xtd::not_supported_exceptionThe socket is not in the xtd::net::sockets::address_family::inter_network_v6 family.
xtd::net::sockets::socket_exceptionAn error occurred when attempting to access the socket.
xtd::object_closed_exceptionThe xtd::net::sockets::socket has been closed.
Note
If you receive a xtd::net::sockets::socket_exception exception, use the xtd::net::sockets::socket_exception::error_code property to obtain the specific error code. After you have obtained this code, refer to the Windows Sockets version 2 API error code documentation in the MSDN library for a detailed description of the error.