SetSocketOption Method (SocketOptionLevel, SocketOptionName, Byte[])
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Sets the specified Socket option to the specified value, represented as a byte array.
Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Syntax
'Declaration
Public Sub SetSocketOption ( _
optionLevel As SocketOptionLevel, _
optionName As SocketOptionName, _
optionValue As Byte() _
)
public void SetSocketOption(
SocketOptionLevel optionLevel,
SocketOptionName optionName,
byte[] optionValue
)
public:
void SetSocketOption(
SocketOptionLevel optionLevel,
SocketOptionName optionName,
array<unsigned char>^ optionValue
)
member SetSocketOption :
optionLevel:SocketOptionLevel *
optionName:SocketOptionName *
optionValue:byte[] -> unit
public function SetSocketOption(
optionLevel : SocketOptionLevel,
optionName : SocketOptionName,
optionValue : byte[]
)
Parameters
- optionLevel
Type: System.Net.Sockets. . :: . .SocketOptionLevel
One of the SocketOptionLevel values.
- optionName
Type: System.Net.Sockets. . :: . .SocketOptionName
One of the SocketOptionName values.
- optionValue
Type: array<System. . :: . .Byte> [] () [] []
An array of type Byte that represents the value of the option.
Remarks
Socket options determine the behavior of the current Socket. Use this overload to set those Socket options that require a byte array as an option value.
Note
If you receive a 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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.