Mentalis.org Security Library documentation

VirtualSocket.GetSocketOption Method (SocketOptionLevel, SocketOptionName)

Gets the value of a specified socket option.

[Visual Basic]
Overridable Overloads Public Function GetSocketOption( _
   ByVal optionLevel As SocketOptionLevel, _
   ByVal optionName As SocketOptionName _
) As Object
[C#]
public virtual object GetSocketOption(
   SocketOptionLevel optionLevel,
   SocketOptionName optionName
);

Parameters

optionLevel
One of the SocketOptionLevel values.
optionName
One of the SocketOptionName values.

Return Value

The value of the option. When the optionName parameter is set to Linger the return value is an instance of the LingerOption. When optionName is set to AddMembership or DropMembership, the return value is an instance of the MulticastOption. When optionName is any other value, the return value is an integer.

Remarks

VirtualSocket options determine the behavior of the current instance. Upon successful completion, GetSocketOption returns an object describing the requested option. For example, if you specify Linger as the option, a LingerOption is returned.

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