Mentalis.org Security Library documentation

VirtualSocket.GetSocketOption Method (SocketOptionLevel, SocketOptionName, Int32)

Returns the value of the specified Socket option and returns in an array.

[Visual Basic]
Overridable Overloads Public Function GetSocketOption( _
   ByVal optionLevel As SocketOptionLevel, _
   ByVal optionName As SocketOptionName, _
   ByVal optionLength As Integer _
) As Byte()
[C#]
public virtual byte[] GetSocketOption(
   SocketOptionLevel optionLevel,
   SocketOptionName optionName,
   int optionLength
);

Parameters

optionLevel
One of the SocketOptionLevel values.
optionName
One of the SocketOptionName values.
optionLength
The length, in bytes, of the expected return value.

Return Value

An array of bytes containing the value of the socket option.

Remarks

The optionLength parameter sets the maximum size of the returned byte array. If the option value requires fewer bytes, the array will contain only that many bytes. If the option value requires more bytes, a SocketException will be thrown.

Exceptions

Exception TypeCondition
SocketExceptionAn operating system error occurs while accessing the VirtualSocket.
ObjectDisposedExceptionThe VirtualSocket has been closed.

See Also

VirtualSocket Class | Org.Mentalis.Security.Ssl Namespace | VirtualSocket.GetSocketOption Overload List