Mentalis.org Security Library documentation

VirtualSocket.SetSocketOption Method (SocketOptionLevel, SocketOptionName, Object)

Sets the specified option to the specified value.

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

Parameters

optionLevel
A SocketOptionLevel value.
optionName
A SocketOptionName value.
optionValue
A LingerOption or MulticastOption containing 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 anything other than an integer or Boolean as an option value. For example, to set the Linger option, you must create an instance of LingerOption and pass it to SetSocketOption as the optionvalue parameter.
Windows 98, Windows NT 4.0 Platform Note: You must call the Bind method before using AddMembership as the optionName parameter.

Exceptions

Exception TypeCondition
SocketExceptionThe VirtualSocket has been closed.
ObjectDisposedExceptionThe VirtualSocket has been closed.
ArgumentNullExceptionoptionValue is a null reference (Nothing in Visual Basic).

See Also

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