Summary of Socket Ioctl Opcodes

The socket ioctl opcodes for Winsock 2 are summarized in the following table. More detailed information is provided in section 4 under WSPIoctl. There are other new protocol-specific ioctl opcodes which can be found in the protocol-specific annex.

Opcode Input Type Output Type Meaning
FIONBIO unsigned long <non used> Enable or disable non-blocking mode on the socket.
FIONREAD <not used> unsigned long Determine the amount of data which can be read atomically from the socket.
SIOCATMARK <not used> BOOL Determine whether or not all out-of-band data has been read.
SIO_ASSOCIATE_HANDLE companion API dependent <not used> Associate the socket with the specified handle of a companion interface.
SIO_ENABLE_CIRCULAR
_QUEUEING
<not used> <not used> Circular queuing is enabled.
SIO_FIND_ROUTE struct sockaddr <not used> Request the route to the specified address to be discovered.
SIO_FLUSH <not used> <not used> Discard current contents of the sending queue.
SIO_GET_BROADCAST
_ADDRESS
<not used> struct sockaddr Retrieve the protocol-specific broadcast address to be used in WSPSendTo.
SIO_GET_QOS <not used> QOS Retrieve current flow spec(s) for the socket.
SIO_GET_GROUP_QOS <not used> QOS Reserved for future use with socket groups; Retrieve current group flow spec(s) for the group this socket belongs to.
SIO_MULTIPOINT
_LOOKBACK
BOOL <not used> Control whether data sent in a multipoint session will also be received by the same socket on the local host.
SIO_MULTICAST_SCOPE int <not used> Specify the scope over which multicast transmissions will occur.
SIO_SET_QOS QOS <not used> Establish new flow spec(s) for the socket.
SIO_SET_GROUP_QOS QOS <not used> Reserved for future use with socket groups; Establish new group flow spec(s) for the group this socket belongs to.
SIO_TRANSLATE_HANDLE int companion API dependent Obtain a corresponding handle for socket s that is valid in the context of a companion interface.
SIO_ROUTING_INTERFACE_QUERY SOCKADDR SOCKADDR Obtain the address of local interface which should be used to send to the specified address
SIO_ROUTING_INTERFACE_CHANGE SOCKADDR <not used> Request notification of changes in information reported via SIO_ROUTING_INTERFACE_QUERY for the specified address
SIO_ADDRESS_LIST_QUERY <not used> SOCKET_ADDRESS_LIST Obtain the list of addresses to which application can bind.
SIO_ADDRESS_LIST_CHANGE <not used> <not used> Request notification of changes in information reported via SIO_ADDRESS_LIST_QUERY
SIO_QUERY_PNP_TARGET_HANDLE <not used> SOCKET Obtain socket descriptor of the next provider in the chain on which current socket depends in PnP sense