Sets the specified System.Net.Sockets.Socket option to the specified value, represented as a byte array.
- optionLevel
- One of the System.Net.Sockets.SocketOptionLevel values.
- optionName
- One of the System.Net.Sockets.SocketOptionName values.
- optionValue
- An array of type byte that represents the value of the option.
Type Reason System.Net.Sockets.SocketException Note: For additional information on causes of the SocketException, see the System.Net.Sockets.SocketException class.System.Security.SecurityException A caller in the call stack does not have the required permissions. ObjectDisposedException The current instance has been disposed.
System.Net.Sockets.Socket options determine the behavior of the current System.Net.Sockets.Socket. Use this overload to set those System.Net.Sockets.Socket options that require a byte array as an option value.
If you receive a System.Net.Sockets.SocketException, use the SocketException.ErrorCode 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.
This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].
Type | Reason |
---|---|
System.Security.Permissions.SecurityPermission | Requires permission to access unmanaged code. See System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode. |