IOControlCode IOControlCode IOControlCode IOControlCode Enum

定义

指定 IOControl(Int32, Byte[], Byte[]) 方法支持的 IO 控制代码。Specifies the IO control codes supported by the IOControl(Int32, Byte[], Byte[]) method.

public enum class IOControlCode
public enum IOControlCode
type IOControlCode = 
Public Enum IOControlCode
继承
IOControlCodeIOControlCodeIOControlCodeIOControlCode

字段

AbsorbRouterAlert AbsorbRouterAlert AbsorbRouterAlert AbsorbRouterAlert 2550136837

此值等于 Winsock 2 SIO_ABSORB_RTRALERT 常数。This value is equal to the Winsock 2 SIO_ABSORB_RTRALERT constant.

AddMulticastGroupOnInterface AddMulticastGroupOnInterface AddMulticastGroupOnInterface AddMulticastGroupOnInterface 2550136842

使用按索引标识的接口联接多播组。Join a multicast group using an interface identified by its index. Windows 2000 及更高版本的操作系统支持此控制代码。This control code is supported on Windows 2000 and later operating systems. 此值等于 Winsock 2 SIO_INDEX_ADD_MCAST 常数。This value is equal to the Winsock 2 SIO_INDEX_ADD_MCAST constant.

AddressListChange AddressListChange AddressListChange AddressListChange 671088663

当套接字协议族的本地接口列表更改时启用接收通知。Enable receiving notification when the list of local interfaces for the socket's protocol family changes. Windows 2000 及更高版本的操作系统支持此控制代码。This control code is supported on Windows 2000 and later operating systems. 此值等于 Winsock 2 SIO_ADDRESS_LIST_CHANGE 常数。This value is equal to the Winsock 2 SIO_ADDRESS_LIST_CHANGE constant.

AddressListQuery AddressListQuery AddressListQuery AddressListQuery 1207959574

返回套接字可绑定到的本地接口列表。Return the list of local interfaces that the socket can bind to. Windows 2000 及更高版本的操作系统支持此控制代码。This control code is supported on Windows 2000 and later operating systems. 此值等于 Winsock 2 SIO_ADDRESS_LIST_QUERY 常数。This value is equal to the Winsock 2 SIO_ADDRESS_LIST_QUERY constant.

AddressListSort AddressListSort AddressListSort AddressListSort 3355443225

AddressListQuery 字段返回的结构进行排序,并为 IPv6 地址添加范围 ID 信息。Sort the structure returned by the AddressListQuery field and add scope ID information for IPv6 addresses. Windows XP 及更高版本的操作系统支持此控制代码。This control code is supported on Windows XP and later operating systems. 此值等于 Winsock 2 SIO_ADDRESS_LIST_SORT 常数。This value is equal to the Winsock 2 SIO_ADDRESS_LIST_SORT constant.

AssociateHandle AssociateHandle AssociateHandle AssociateHandle 2281701377

将此套接字与附带接口的指定句柄关联。Associate this socket with the specified handle of a companion interface. 有关其他详细信息,请参考 Winsock 2 参考或文档中特定附带接口的相应协议特定附录。Refer to the appropriate protocol-specific annex in the Winsock 2 reference or documentation for the particular companion interface for additional details. 建议使用组件对象模型 (COM) 代替此 IOCTL,以发现并跟踪套接字可能支持的其他接口。It is recommended that the Component Object Model (COM) be used instead of this IOCTL to discover and track other interfaces that might be supported by a socket. 此控制代码是为了与某些系统保持向后兼容而提供的,在这些系统中,COM 不可用或由于某些其他原因而无法使用。This control code is present for backward compatibility with systems where COM is not available or cannot be used for some other reason. 此值等于 Winsock 2 SIO_ASSOCIATE_HANDLE 常数。This value is equal to the Winsock 2 SIO_ASSOCIATE_HANDLE constant.

AsyncIO AsyncIO AsyncIO AsyncIO 2147772029

当等待接收数据时启用通知。Enable notification for when data is waiting to be received. 此值等于 Winsock 2 FIOASYNC 常数。This value is equal to the Winsock 2 FIOASYNC constant.

BindToInterface BindToInterface BindToInterface BindToInterface 2550136840

将套接字绑定到指定的接口索引。Bind the socket to a specified interface index. Windows 2000 及更高版本的操作系统支持此控制代码。This control code is supported on Windows 2000 and later operating systems. 此值等于 Winsock 2 SIO_INDEX_BIND 常数。This value is equal to the Winsock 2 SIO_INDEX_BIND constant.

DataToRead DataToRead DataToRead DataToRead 1074030207

返回可读取的字节数。Return the number of bytes available for reading. 此值等于 Winsock 2 FIONREAD 常数。This value is equal to the Winsock 2 FIONREAD constant.

DeleteMulticastGroupFromInterface DeleteMulticastGroupFromInterface DeleteMulticastGroupFromInterface DeleteMulticastGroupFromInterface 2550136843

从多播组中移除套接字。Remove the socket from a multicast group. Windows 2000 及更高版本的操作系统支持此控制代码。This control code is supported on Windows 2000 and later operating systems. 此值等于 Winsock 2 SIO_INDEX_ADD_MCAST 常数。This value is equal to the Winsock 2 SIO_INDEX_ADD_MCAST constant.

EnableCircularQueuing EnableCircularQueuing EnableCircularQueuing EnableCircularQueuing 671088642

当传入的消息队列已满时,将时间最久的已排队数据报替换为传入的数据报。Replace the oldest queued datagram with an incoming datagram when the incoming message queues are full. 此值等于 Winsock 2 SIO_ENABLE_CIRCULAR_QUEUEING 常数。This value is equal to the Winsock 2 SIO_ENABLE_CIRCULAR_QUEUEING constant.

Flush Flush Flush Flush 671088644

放弃发送队列的内容。Discard the contents of the sending queue. 此值等于 Winsock 2 SIO_FLUSH 常数。This value is equal to the Winsock 2 SIO_FLUSH constant.

GetBroadcastAddress GetBroadcastAddress GetBroadcastAddress GetBroadcastAddress 1207959557

返回一个 SOCKADDR 结构,该结构包含当前套接字地址族的广播地址。Return a SOCKADDR structure that contains the broadcast address for the address family of the current socket. 返回的地址可与 SendTo 方法一起使用。The returned address can be used with the SendTo method. 此值等于 Winsock 2 SIO_GET_BROADCAST_ADDRESS 常数。This value is equal to the Winsock 2 SIO_GET_BROADCAST_ADDRESS constant. 此值仅可用于用户数据报协议 (UDP) 套接字。This value can be used on User Datagram Protocol (UDP) sockets only.

GetExtensionFunctionPointer GetExtensionFunctionPointer GetExtensionFunctionPointer GetExtensionFunctionPointer 3355443206

获取提供程序特定的函数,这类函数不是 Winsock 规范的一部分。Obtain provider-specific functions that are not part of the Winsock specification. 这些函数通过使用其提供程序分配的 GUID 进行指定。Functions are specified using their provider-assigned GUID. 此值等于 Winsock 2 SIO_GET_EXTENSION_FUNCTION_POINTER 常数。This value is equal to the Winsock 2 SIO_GET_EXTENSION_FUNCTION_POINTER constant.

GetGroupQos GetGroupQos GetGroupQos GetGroupQos 3355443208

返回套接字组的服务质量 (QOS) 特性。Return the Quality of Service (QOS) attributes for the socket group. 此值保留供将来使用,并且等于 Winsock 2 SIO_GET_GROUP_QOS 常数。This value is reserved for future use, and is equal to the Winsock 2 SIO_GET_GROUP_QOS constant.

GetQos GetQos GetQos GetQos 3355443207

检索与套接字关联的 QOS 结构。Retrieve the QOS structure associated with the socket. 只有能提供 QOS 传输的平台(Windows Me、Windows 2000 和更高版本)才支持此控件。此值等于 Winsock 2 SIO_GET_QOS 常数。This control is only supported on platforms that provide a QOS capable transport (Windows Me, Windows 2000, and later.) This value is equal to the Winsock 2 SIO_GET_QOS constant.

KeepAliveValues KeepAliveValues KeepAliveValues KeepAliveValues 2550136836

控制 TCP Keep-Alive 数据包的发送以及发送间隔。Control sending TCP keep-alive packets and the interval at which they are sent. Windows 2000 及更高版本的操作系统支持此控制代码。This control code is supported on Windows 2000 and later operating systems. 有关其他信息,请参阅 RFC 1122 的 4.2.3.6 节。For additional information, see RFC 1122 section 4.2.3.6. 此值等于 Winsock 2 SIO_KEEPALIVE_VALS 常数。This value is equal to the Winsock 2 SIO_KEEPALIVE_VALS constant.

LimitBroadcasts LimitBroadcasts LimitBroadcasts LimitBroadcasts 2550136839

此值等于 Winsock 2 SIO_LIMIT_BROADCASTS 常数。This value is equal to the Winsock 2 SIO_LIMIT_BROADCASTS constant.

MulticastInterface MulticastInterface MulticastInterface MulticastInterface 2550136841

设置用于传出多播数据包的接口。Set the interface used for outgoing multicast packets. 该接口由索引进行标识。The interface is identified by its index. Windows 2000 及更高版本的操作系统支持此控制代码。This control code is supported on Windows 2000 and later operating systems. 此值等于 Winsock 2 SIO_INDEX_MCASTIF 常数。This value is equal to the Winsock 2 SIO_INDEX_MCASTIF constant.

MulticastScope MulticastScope MulticastScope MulticastScope 2281701386

控制路由器可以转发多播数据包的次数,也称作生存时间 (TTL) 或跃点计数。Control the number of times a multicast packet can be forwarded by a router, also known as the Time to Live (TTL), or hop count. 此值等于 Winsock 2 SIO_MULTICAST_SCOPE 常数。This value is equal to the Winsock 2 SIO_MULTICAST_SCOPE constant.

MultipointLoopback MultipointLoopback MultipointLoopback MultipointLoopback 2281701385

控制套接字发送的多播数据是否在套接字接收队列中显示为传入数据。Control whether multicast data sent by the socket appears as incoming data in the sockets receive queue. 此值等于 Winsock 2 SIO_MULTIPOINT_LOOPBACK 常数。This value is equal to the Winsock 2 SIO_MULTIPOINT_LOOPBACK constant.

NamespaceChange NamespaceChange NamespaceChange NamespaceChange 2281701401

控制套接字是否在命名空间查询无效时接收通知。Control whether the socket receives notification when a namespace query becomes invalid. Windows XP 及更高版本的操作系统支持此控制代码。This control code is supported on Windows XP and later operating systems. 此值等于 Winsock 2 SIO_NSP_NOTIFY_CHANGE 常数。This value is equal to the Winsock 2 SIO_NSP_NOTIFY_CHANGE constant.

NonBlockingIO NonBlockingIO NonBlockingIO NonBlockingIO 2147772030

控制套接字的阻止行为。Control the blocking behavior of the socket. 如果使用此控制代码指定的参数为零,套接字置于阻止模式下。If the argument specified with this control code is zero, the socket is placed in blocking mode. 如果参数不为零,套接字置于非阻止模式下。If the argument is nonzero, the socket is placed in nonblocking mode. 此值等于 Winsock 2 FIONBIO 常数。This value is equal to the Winsock 2 FIONBIO constant.

OobDataRead OobDataRead OobDataRead OobDataRead 1074033415

返回有关等待接收的带外数据的信息。Return information about out-of-band data waiting to be received. 在流式套接字上使用此控制代码时,返回值指示可用的字节数。When using this control code on stream sockets, the return value indicates the number of bytes available.

QueryTargetPnpHandle QueryTargetPnpHandle QueryTargetPnpHandle QueryTargetPnpHandle 1207959576

检索基础提供程序的 SOCKET 句柄。Retrieve the underlying provider's SOCKET handle. 此句柄可用于接收即插即用事件通知。This handle can be used to receive plug-and-play event notification. Windows 2000 及更高版本的操作系统支持此控制代码。This control code is supported on Windows 2000 and later operating systems. 此值等于 Winsock 2 SIO_QUERY_TARGET_PNP_HANDLE 常数。This value is equal to the Winsock 2 SIO_QUERY_TARGET_PNP_HANDLE constant.

ReceiveAll ReceiveAll ReceiveAll ReceiveAll 2550136833

支持接收网络上的所有 IPv4 数据包。Enable receiving all IPv4 packets on the network. 套接字必须有 InterNetwork 地址族,套接字类型必须是 Raw,并且协议类型必须为 IPThe socket must have address family InterNetwork, the socket type must be Raw, and the protocol type must be IP. 当前用户必须属于本地计算机上的管理员组,并且套接字必须绑定到特定端口。The current user must belong to the Administrators group on the local computer, and the socket must be bound to a specific port. Windows 2000 及更高版本的操作系统支持此控制代码。This control code is supported on Windows 2000 and later operating systems. 此值等于 Winsock 2 SIO_RCVALL 常数。This value is equal to the Winsock 2 SIO_RCVALL constant.

ReceiveAllIgmpMulticast ReceiveAllIgmpMulticast ReceiveAllIgmpMulticast ReceiveAllIgmpMulticast 2550136835

支持接收网络上所有 Internet 组管理协议 (IGMP) 数据包。Enable receiving all Internet Group Management Protocol (IGMP) packets on the network. 套接字必须有 InterNetwork 地址族,套接字类型必须是 Raw,并且协议类型必须为 IgmpThe socket must have address family InterNetwork, the socket type must be Raw, and the protocol type must be Igmp. 当前用户必须属于本地计算机上的管理员组,并且套接字必须绑定到特定端口。The current user must belong to the Administrators group on the local computer, and the socket must be bound to a specific port. Windows 2000 及更高版本的操作系统支持此控制代码。This control code is supported on Windows 2000 and later operating systems. 此值等于 Winsock 2 SIO_RCVALL_IGMPMCAST 常数。This value is equal to the Winsock 2 SIO_RCVALL_IGMPMCAST constant.

ReceiveAllMulticast ReceiveAllMulticast ReceiveAllMulticast ReceiveAllMulticast 2550136834

支持接收网络上所有多播 IPv4 数据包。Enable receiving all multicast IPv4 packets on the network. 这些数据包的目标地址范围介于 224.0.0.0 到 239.255.255.255 之间。These are packets with destination addresses in the range 224.0.0.0 through 239.255.255.255. 套接字必须有 InterNetwork 地址族,套接字类型必须是 Raw,并且协议类型必须为 UdpThe socket must have address family InterNetwork, the socket type must be Raw, and the protocol type must be Udp. 当前用户必须属于本地计算机上的管理员组,并且套接字必须绑定到特定端口。The current user must belong to the Administrators group on the local computer, and the socket must be bound to a specific port. Windows 2000 及更高版本的操作系统支持此控制代码。This control code is supported on Windows 2000 and later operating systems. 此值等于 Winsock 2 SIO_RCVALL_MCAST 常数。This value is equal to the Winsock 2 SIO_RCVALL_MCAST constant.

RoutingInterfaceChange RoutingInterfaceChange RoutingInterfaceChange RoutingInterfaceChange 2281701397

支持在用于访问远程终结点的本地接口更改时接收通知。Enable receiving notification when the local interface used to access a remote endpoint changes. 此值等于 Winsock 2 SIO_ROUTING_INTERFACE_CHANGE 常数。This value is equal to the Winsock 2 SIO_ROUTING_INTERFACE_CHANGE constant.

RoutingInterfaceQuery RoutingInterfaceQuery RoutingInterfaceQuery RoutingInterfaceQuery 3355443220

返回可用于连接到指定远程地址的接口地址。Return the interface addresses that can be used to connect to the specified remote address. 此值等于 Winsock 2 SIO_ROUTING_INTERFACE_QUERY 常数。This value is equal to the Winsock 2 SIO_ROUTING_INTERFACE_QUERY constant.

SetGroupQos SetGroupQos SetGroupQos SetGroupQos 2281701388

设置套接字组的服务质量 (QOS) 特性。Set the Quality of Service (QOS) attributes for the socket group. 此值保留供将来使用,并且等于 Winsock 2 SIO_SET_GROUP_QOS 常数。This value is reserved for future use and is equal to the Winsock 2 SIO_SET_GROUP_QOS constant.

SetQos SetQos SetQos SetQos 2281701387

设置套接字的服务质量 (QOS) 特性。Set the Quality of Service (QOS) attributes for the socket. QOS 用于定义套接字的带宽要求。QOS defines the bandwidth requirements for the socket. Windows Me、Windows 2000 及更高版本的操作系统支持此控制代码。This control code is supported on Windows Me, Windows 2000, and later operating systems. 此值等于 Winsock 2 SIO_SET_QOS 常数。This value is equal to the Winsock 2 SIO_SET_QOS constant.

TranslateHandle TranslateHandle TranslateHandle TranslateHandle 3355443213

返回附带接口上下文中有效套接字的句柄。Return a handle for the socket that is valid in the context of a companion interface. 此值等于 Winsock 2 SIO_TRANSLATE_HANDLE 常数。This value is equal to the Winsock 2 SIO_TRANSLATE_HANDLE constant.

UnicastInterface UnicastInterface UnicastInterface UnicastInterface 2550136838

设置用于传出单播数据包的接口。Set the interface used for outgoing unicast packets. 此值等于 Winsock 2 SIO_UCAST_IF 常数。This value is equal to the Winsock 2 SIO_UCAST_IF constant.

示例

下面的代码示例调用IOControl(IOControlCode, Byte[], Byte[])DataToRead 参数值的方法并将访问的结果进行比较。AvailableThe following code example calls the IOControl(IOControlCode, Byte[], Byte[]) method with a DataToRead parameter value and compares the result with accessing the.Available 属性。property.

void DisplayPendingByteCount( Socket^ s )
{
   array<Byte>^ outValue = BitConverter::GetBytes( 0 );
   
   // Check how many bytes have been received.
   s->IOControl( IOControlCode::DataToRead, nullptr, outValue );

   UInt32 bytesAvailable = BitConverter::ToUInt32( outValue, 0 );
   Console::Write( "server has {0} bytes pending,",
      bytesAvailable );
   Console::WriteLine( "Available property says {1}.",
      s->Available );
   return;
}
static void DisplayPendingByteCount(Socket s)
{
    byte[] outValue = BitConverter.GetBytes(0);

    // Check how many bytes have been received.
    s.IOControl(IOControlCode.DataToRead, null, outValue);

    uint bytesAvailable = BitConverter.ToUInt32(outValue, 0);
    Console.Write("server has {0} bytes pending. ", 
        bytesAvailable);
    Console.WriteLine("Available property says {1}.",
                     s.Available);

    return;
}

注解

IOControlCode枚举提供已命名的值用于指定套接字操作模式。The IOControlCode enumeration provides named values for specifying socket operational modes. 这些值是传递给 Windows 套接字 2 (Winsock 2) 的控制代码WSAIoctl函数。These values are the control codes passed to the Windows Sockets 2 (Winsock 2) WSAIoctl function.

适用于