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

◆ get_socket_option()

int32 xtd::net::sockets::socket::get_socket_option ( xtd::net::sockets::socket_option_level  socket_option_level,
xtd::net::sockets::socket_option_name  socket_option_name 
) const

Returns the value of a specified xtd::net::sockets::socket option, represented as integer.

Parameters
socket_option_levelOne of the xtd::net::sockets::socket_option_level values.
socket_option_nameOne of the xtd::net::sockets::socket_option_name values.
Returns
An object that represents the value of the option.
Exceptions
xtd::net::sockets::socket_exceptionAn error occurred when attempting to access the socket.
xtd::object_closed_exceptionThe xtd::net::sockets::socket has been closed.
Remarks
xtd::net::sockets::socket options determine the behavior of the current xtd::net::sockets::socket.
Use xtd::net::sockets::socket::get_socket_linger_option to get the xtd::net::sockets::socket_option_name::linger.
Use xtd::net::sockets::socket::get_socket_multicast_option xtd::net::sockets::socket_option_name::add_membership, and xtd::net::sockets::socket_option_name::xtd::net::sockets::socket_option_name::drop_membership xtd::net::sockets::socket options for IP v4 socket.
Use xtd::net::sockets::socket::get_socket_ip_v6__multicast_option xtd::net::sockets::socket_option_name::add_membership, and xtd::net::sockets::socket_option_name::xtd::net::sockets::socket_option_name::drop_membership xtd::net::sockets::socket options for IP v6 socket.
Note
If you receive a xtd::net::sockets::socket_exception, use the xtd::net::sockets::socket_exception 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 for a detailed description of the error.