IOControlCode IOControlCode IOControlCode IOControlCode Enum

Definition

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
Inheritance
IOControlCodeIOControlCodeIOControlCodeIOControlCode

Fields

AbsorbRouterAlert AbsorbRouterAlert AbsorbRouterAlert AbsorbRouterAlert 2550136837

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. This control code is supported on Windows 2000 and later operating systems. 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. This control code is supported on Windows 2000 and later operating systems. 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. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_ADDRESS_LIST_QUERY constant.

AddressListSort AddressListSort AddressListSort AddressListSort 3355443225

Sort the structure returned by the AddressListQuery field and add scope ID information for IPv6 addresses. This control code is supported on Windows XP and later operating systems. 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. Refer to the appropriate protocol-specific annex in the Winsock 2 reference or documentation for the particular companion interface for additional details. 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. This control code is present for backward compatibility with systems where COM is not available or cannot be used for some other reason. 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. This value is equal to the Winsock 2 FIOASYNC constant.

BindToInterface BindToInterface BindToInterface BindToInterface 2550136840

Bind the socket to a specified interface index. This control code is supported on Windows 2000 and later operating systems. 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. This value is equal to the Winsock 2 FIONREAD constant.

DeleteMulticastGroupFromInterface DeleteMulticastGroupFromInterface DeleteMulticastGroupFromInterface DeleteMulticastGroupFromInterface 2550136843

Remove the socket from a multicast group. This control code is supported on Windows 2000 and later operating systems. 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. 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. This value is equal to the Winsock 2 SIO_FLUSH constant.

GetBroadcastAddress GetBroadcastAddress GetBroadcastAddress GetBroadcastAddress 1207959557

Return a SOCKADDR structure that contains the broadcast address for the address family of the current socket. The returned address can be used with the SendTo method. This value is equal to the Winsock 2 SIO_GET_BROADCAST_ADDRESS constant. This value can be used on User Datagram Protocol (UDP) sockets only.

GetExtensionFunctionPointer GetExtensionFunctionPointer GetExtensionFunctionPointer GetExtensionFunctionPointer 3355443206

Obtain provider-specific functions that are not part of the Winsock specification. Functions are specified using their provider-assigned GUID. This value is equal to the Winsock 2 SIO_GET_EXTENSION_FUNCTION_POINTER constant.

GetGroupQos GetGroupQos GetGroupQos GetGroupQos 3355443208

Return the Quality of Service (QOS) attributes for the socket group. This value is reserved for future use, and is equal to the Winsock 2 SIO_GET_GROUP_QOS constant.

GetQos GetQos GetQos GetQos 3355443207

Retrieve the QOS structure associated with the socket. 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

Control sending TCP keep-alive packets and the interval at which they are sent. This control code is supported on Windows 2000 and later operating systems. For additional information, see RFC 1122 section 4.2.3.6. This value is equal to the Winsock 2 SIO_KEEPALIVE_VALS constant.

LimitBroadcasts LimitBroadcasts LimitBroadcasts LimitBroadcasts 2550136839

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. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_MCASTIF constant.

MulticastScope MulticastScope MulticastScope MulticastScope 2281701386

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. 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. 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. This control code is supported on Windows XP and later operating systems. 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. 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

Retrieve the underlying provider's SOCKET handle. This handle can be used to receive plug-and-play event notification. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_QUERY_TARGET_PNP_HANDLE constant.

ReceiveAll ReceiveAll ReceiveAll ReceiveAll 2550136833

Enable receiving all IPv4 packets on the network. The 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. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_RCVALL constant.

ReceiveAllIgmpMulticast ReceiveAllIgmpMulticast ReceiveAllIgmpMulticast ReceiveAllIgmpMulticast 2550136835

Enable receiving all Internet Group Management Protocol (IGMP) packets on the network. The 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. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_RCVALL_IGMPMCAST constant.

ReceiveAllMulticast ReceiveAllMulticast ReceiveAllMulticast ReceiveAllMulticast 2550136834

Enable receiving all multicast IPv4 packets on the network. These are packets with destination addresses in the range 224.0.0.0 through 239.255.255.255. The 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. This control code is supported on Windows 2000 and later operating systems. 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. 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. This value is equal to the Winsock 2 SIO_ROUTING_INTERFACE_QUERY constant.

SetGroupQos SetGroupQos SetGroupQos SetGroupQos 2281701388

Set the Quality of Service (QOS) attributes for the socket group. This value is reserved for future use and is equal to the Winsock 2 SIO_SET_GROUP_QOS constant.

SetQos SetQos SetQos SetQos 2281701387

Set the Quality of Service (QOS) attributes for the socket. QOS defines the bandwidth requirements for the socket. This control code is supported on Windows Me, Windows 2000, and later operating systems. 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. 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. This value is equal to the Winsock 2 SIO_UCAST_IF constant.

Examples

The 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;
}

Remarks

The IOControlCode enumeration provides named values for specifying socket operational modes. These values are the control codes passed to the Windows Sockets 2 (Winsock 2) WSAIoctl function.

Applies to