GetSocketOption Method (SocketOptionLevel, SocketOptionName)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Returns the value of a specified Socket option, represented as an object.
Assembly: System (in System.dll)
member GetSocketOption : optionLevel:SocketOptionLevel * optionName:SocketOptionName -> Object
Return ValueType: System..::..Object
An object that represents the value of the option. When the optionName parameter is set to Linger the return value is an instance of the class. When optionName is set to AddMembership or DropMembership, the return value is an instance of the class. When optionName is any other value, the return value is an integer.
Socket options determine the behavior of the current Socket. Use this overload to get the Linger, AddMembership, and DropMembership Socket options. For the Linger option, use Socket for the optionLevel parameter. For AddMembership and DropMembership, use IP. If you want to set the value of any of the options listed above, use the SetSocketOption method.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.