System.Net.Sockets.Socket.IOControl Method

Sets low-level operating modes for the System.Net.Sockets.Socket using the System.Net.Sockets.IOControlCode enumeration to specify control codes.

Syntax

public int IOControl (IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)

Parameters

ioControlCode
A System.Net.Sockets.IOControlCode value that specifies the control code of the operation to perform.
optionInValue
An array of type byte that contains the input data required by the operation.
optionOutValue
An array of type byte that contains the output data returned by the operation.

Returns

The number of bytes in the optionOutValue parameter.

Remarks

This method provides low-level access to the operating system System.Net.Sockets.Socket underlying the current instance of the System.Net.Sockets.Socket class. For more, see the WSAIoctl documentation in the MSDN library.

Note:

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.

Note:

This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0