Returns the value of the specified System.Net.Sockets.Socket option in an array.
- length
- Documentation for this section has not yet been entered.
- optionLevel
- One of the System.Net.Sockets.SocketOptionLevel values.
- optionName
- One of the System.Net.Sockets.SocketOptionName values.
An array of type byte that contains the value of the socket option.
Type Reason System.Net.Sockets.SocketException optionLength is smaller than the number of bytes required to store the value of the specified socket option.
-or-
An error occurred while accessing the socket.
Note: For additional information on causes of the SocketException, see the System.Net.Sockets.SocketException class.ObjectDisposedException The current instance has been disposed.
The optionLength parameter sets the maximum size of the returned byte array. If the option value requires fewer bytes, the array will contain only that many bytes. If the option value requires more bytes, Socket.GetSocketOption(SocketOptionLevel, SocketOptionName) will throw a System.Net.Sockets.SocketException. Use this overload for any sockets that are represented by Boolean values or integers.
If you receive a System.Net.Sockets.SocketException, use the SocketException.ErrorCode property to obtain the specific error code. After you have obtained this code, refer to the Windows Sockets version 2 API error code documentation in the MSDN library for a detailed description of the error.
This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].