GetSocketOption Method (SocketOptionLevel, SocketOptionName, Byte[])
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Returns the specified Socket option setting, represented as a byte array.
Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Syntax
'Declaration
Public Sub GetSocketOption ( _
optionLevel As SocketOptionLevel, _
optionName As SocketOptionName, _
val As Byte() _
)
public void GetSocketOption(
SocketOptionLevel optionLevel,
SocketOptionName optionName,
byte[] val
)
public:
void GetSocketOption(
SocketOptionLevel optionLevel,
SocketOptionName optionName,
array<unsigned char>^ val
)
member GetSocketOption :
optionLevel:SocketOptionLevel *
optionName:SocketOptionName *
val:byte[] -> unit
public function GetSocketOption(
optionLevel : SocketOptionLevel,
optionName : SocketOptionName,
val : byte[]
)
Parameters
- optionLevel
Type: System.Net.Sockets. . :: . .SocketOptionLevel
One of the SocketOptionLevel values.
- optionName
Type: System.Net.Sockets. . :: . .SocketOptionName
One of the SocketOptionName values.
- val
Type: array<System. . :: . .Byte> [] () [] []
An array of type Byte that is to receive the option setting.
Remarks
Socket options determine the behavior of the current Socket. Upon successful completion of this method, the array specified by the val parameter contains the value of the specified Socket option.
When the length of the val array is smaller than the number of bytes required to store the value of the specified Socket option, GetSocketOption will throw a SocketException. 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. Use this overload for any sockets that are represented by Boolean values or integers.
.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.