Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[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.
Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Syntax
'Declaration
Public Function GetSocketOption ( _
optionLevel As SocketOptionLevel, _
optionName As SocketOptionName _
) As Object
public Object GetSocketOption(
SocketOptionLevel optionLevel,
SocketOptionName optionName
)
public:
Object^ GetSocketOption(
SocketOptionLevel optionLevel,
SocketOptionName optionName
)
member GetSocketOption :
optionLevel:SocketOptionLevel *
optionName:SocketOptionName -> Object
public function GetSocketOption(
optionLevel : SocketOptionLevel,
optionName : SocketOptionName
) : Object
Parameters
- optionLevel
Type: System.Net.Sockets. . :: . .SocketOptionLevel
One of the SocketOptionLevel values.
- optionName
Type: System.Net.Sockets. . :: . .SocketOptionName
One of the SocketOptionName values.
Return Value
Type: 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 LingerOption class. When optionName is set to AddMembership or DropMembership, the return value is an instance of the MulticastOption class. When optionName is any other value, the return value is an integer.
Remarks
Socket options determine the behavior of the current Socket. Use this overload to get the Linger, AddMembership, and DropMembershipSocket 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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.