Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 2.6 KB

socket-attribute-flags-and-modes-2.md

File metadata and controls

19 lines (13 loc) · 2.6 KB
description ms.assetid title ms.topic ms.date
There are several socket attributes which can be indicated through the flags parameter in WSPSocket.
5fd4321b-a5cc-4921-bec5-bdf625261ea2
Socket Attribute Flags and Modes
article
05/31/2018

Socket Attribute Flags and Modes

There are several socket attributes which can be indicated through the flags parameter in WSPSocket. The WSA_FLAG_OVERLAPPED flag indicates that a socket will be used for overlapped I/O operations. Support of this attribute is mandatory for all service providers. See Overlapped I/O for more information. Note that creating a socket with the overlapped attribute has no impact on whether a socket is currently in blocking or nonblocking mode. Sockets created with the overlapped attribute may be used to perform overlapped I/O, and doing so does not change the blocking mode of a socket. Since overlapped I/O operations do not block, the blocking mode of a socket is irrelevant for these operations.

Four additional attribute flags are used when creating sockets that are to be used for multipoint and/or multicast operations, and support for these attributes is optional. Providers that support multipoint attributes indicate this through the XP1_SUPPPORT_MULTIPOINT bit in their respective WSAPROTOCOL_INFO structures. See WSPSocket and Protocol-Independent Multicast and Multipoint in the API for the definition and usage of each of these flags. Only sockets that are created with multipoint-related attributes can be used in the WSPJoinLeaf function for creating multipoint sessions.

A socket is in one of two modes, blocking and nonblocking, at any time. Sockets are created in the blocking mode by default, and can be changed to nonblocking mode by calling WSPAsyncSelect, WSPEventSelect, or WSPIoctl. A socket can be switched back to blocking mode by using WSPIoctl if no WSPAsyncSelect or WSPEventSelect is active. The mode for a socket only affects those functions which may block, and does not affect overlapped I/O operations. See Blocking Operations for more information.