NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Socket.SetSockOpt (Int32, Int32, Object)

Sets the specified option to the specified value.

[Visual Basic]
Overloads Public Function SetSockOpt( _
   ByVal optionLevel As Integer, _
   ByVal optionName As Integer, _
   ByVal optionValue As Object _
) As Boolean
[C#]
public bool SetSockOpt(
   int optionLevel,
   int optionName,
   object optionValue
);
[C++]
public: bool SetSockOpt(
   int optionLevel,
   int optionName,
   Object* optionValue
);
[JScript]
public function SetSockOpt(
   optionLevel : int,
   optionName : int,
   optionValue : Object
) : Boolean;

Parameters

optionLevel
The level at which the option is defined. Can be either OptionLevelIP or OptionLevelTCP
optionName
The name of the option to set. See the SocketOption class for the valid options.
optionValue
An instance of LingerOption or MulticastOption containing the value of the option.

Return Value

true if the option was successfully set; otherwise, returns false.

Exceptions

Exception Type Condition
ArgumentException The object specified by optionValue is not an instance of LingerOption or MulticastOption.

See Also

Socket Class | Socket Members | System.Net.Sockets Namespace | Socket.SetSockOpt Overload List