Winsock Programming Considerations

Windows Sockets 2 extends the functionality of Windows Sockets 1.1 in a number of areas. The following table summarizes some of the major feature changes.

Features Description
Windows Sockets 2 Architecture A description of the Windows Sockets 2 architecture.
Socket handles A socket handle can optionally be a file handle in Windows Sockets 2. It is possible to use socket handles with standard Windows file I/O functions.
Simultaneous access to multiple transport protocols Allows an application to use the familiar socket interface to achieve simultaneous access to a number of installed transport protocols.
Protocol-independent name resolution Includes a standardized set of functions for querying and working with the myriad name resolution domains that exist today (for example DNS, SAP, and X.500).
Protocol-independent multicast and multipoint Applications discover what type of multipoint or multicast capabilities a transport provides and use these facilities in a generic manner.
Overlapped I/O Incorporates the overlapped paradigm for socket I/O following the model established in Windows environments.
Scatter/gather I/O Incorporates scatter/gather capabilities with the overlapped paradigm for socket I/O, following the model established in Windows environments.
Quality of Service (QoS) Establishes conventions that applications use to negotiate required service levels for parameters such as bandwidth and latency. Other QoS-related enhancements include mechanisms for network-specific Quality of Service extensions.
Provider-Specific Extension Mechanism The WSAIoctl function enables service providers to offer provider-specific feature extensions.
Shared Sockets The WSADuplicateSocket function is introduced to enable socket sharing across processes.
Connection Setup and Teardown An application can obtain caller information such as caller identifier and Quality of Service before deciding whether to accept an incoming connection request. It is also possible (for protocols that support this) to exchange user data between the endpoints at connection teardown time.
Graceful Shutdown, Linger Options, and Socket Closure An application has several options for shutting down a socket connection (shutdown sequence).
Protocol-Independent Out-of-Band Data The stream socket abstraction includes the notion of out of band (OOB) data.
Debug and Trace Facilities Windows Sockets 2 supports a specially devised version of the Ws2_32.dll and a separate debug/trace DLL.
Windows Sockets Compatibility Issues Windows Sockets 2 continues to support all of the Windows Sockets 1.1 semantics and function calls except for those dealing with pseudo-blocking.
Handling Winsock Errors How Winsock errors can be retrieved and handled by an application.