Mentalis.org Security Library documentation

VirtualSocket.SetSocketOption Method (SocketOptionLevel, SocketOptionName, Int32)

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 Integer _
)
[C#]
public virtual void SetSocketOption(
   SocketOptionLevel optionLevel,
   SocketOptionName optionName,
   int optionValue
);

Parameters

optionLevel
A SocketOptionLevel value.
optionName
A SocketOptionName value.
optionValue
A value of the option.

Remarks

Socket options determine the behavior of the current Socket. For an option with a Boolean data type, specify a nonzero value to enable the option, and a zero value to disable the option. For an option with an integer data type, specify the appropriate value. Socket options are grouped by level of protocol support.
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.

See Also

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