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

◆ set_raw_socket_option()

void xtd::net::sockets::socket::set_raw_socket_option ( int32  socket_option_level,
int32  socket_option_name,
intptr  option_value,
size_t  option_value_size 
)

Sets a socket option value using platform-specific level and name identifiers.

Parameters
socket_option_levelThe platform-defined option name.
socket_option_nameThe platform-defined option name.
option_valueA pointer of the option value.
size_option_valueThe size of the option value.
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
In general, the xtd::net::sockets::socket::set_socket_option method should be used whenever setting a xtd::net::sockets::socket option.
The SetRawSocketOption(Int32, Int32, ReadOnlySpan<byte>) method should be used only when SocketOptionLevel and SocketOptionName do not expose the required option.
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.