Windows* Sockets 2 Application Programming Interface An Interface for Transparent Network Programming Under Microsoft Windowstm revision 2 August 7, 1997



Download 1.64 Mb.
Page2/49
Date31.07.2017
Size1.64 Mb.
#24975
1   2   3   4   5   6   7   8   9   ...   49

1 Introduction


This document specifies the Windows Sockets 2 programming interface. Windows Sockets 2 utilizes the sockets paradigm as first popularized in BSD UNIX1 and as adapted for Microsoft Windows in the Windows Sockets 1.1 specification. While historically sockets programming in general and Windows Sockets programming in particular has been TCP/IP-centric, this is no longer the case. Consequently, it is important to realize that Windows Sockets 2 is an interface and not a protocol. As an interface it is used to discover and utilize the communications capabilities of any number of underlying transport protocols. Because it is not a protocol, it does not in any way affect the “bits on the wire”, and does not need to be utilized on both ends of a communications link.

The motivation in creating version 2 of Windows Sockets was primarily to provide a protocol-independent transport interface that is fully capable of supporting emerging networking capabilities including real-time multimedia communications. Thus Windows Sockets 2 is a true superset of the widely deployed Windows Sockets 1.1 interface. While maintaining full backwards compatibility it extends the Windows Sockets interface in a number of areas including



  • Access to protocols other than TCP/IP: WinSock 2 allows an application to use the familiar socket interface to achieve simultaneous access to any number of installed transport protocols.

  • Protocol-independent name resolution facilities: WinSock 2 includes a standardized set of APIs for querying and working with the myriad of name resolution domains that exist today (e.g. DNS, SAP, X.500, etc.)

  • Overlapped I/O with scatter/gather: following the model established in Win32 environments, WinSock 2 incorporates the overlapped paradigm for socket I/O and incorporates scatter/gather capabilities as well.

  • Quality of service: WinSock 2 establishes conventions for applications to negotiate required service levels for parameters such as bandwidth and latency. Other QOS-related enhancements include socket grouping and prioritization, and mechanisms for network-specific QOS extensions.

  • Protocol-independent multicast and multipoint: applications can discover what type of multipoint or multicast capabilities a transport provides and use these facilities in a generic manner.

  • Other frequently requested extensions: shared sockets, conditional acceptance, exchange of user data at connection setup/teardown time, protocol-specific extension mechanisms.

It is almost always the case that adding more capability and functionality also increases the level of complexity, and Windows Sockets 2 is no exception. We have attempted to mitigate this as much as possible by extending the familiar sockets interface as opposed to starting from scratch. While this approach offers significant benefit to experienced socket programmers, it may occasionally vex them as well since certain widely held assumptions are no longer valid. For example, many sockets programmers assume that all connectionless protocols use SOCK_DGRAM sockets and all connection-oriented protocols use SOCK_STREAM sockets. In WinSock 2 SOCK_DGRAM and SOCK_STREAM are only two of many possible socket types, and programmers should no longer rely on socket type to describe all of the essential attributes of a transport protocol.

With its vastly larger scope, Windows Sockets 2 takes the socket paradigm considerably beyond what it’s original designers contemplated. As a consequence, a number of new functions have been added, all of which are assigned names that are prefixed with “WSA”. In all but a few instances these new functions are expanded versions of an existing function from BSD sockets. The need to retain backwards compatibility mandates that we retain both the “just plain” BSD functions and the new “WSA” versions, which in turn amplifies the perception of WinSock 2 as being large and complex. This stretching of the sockets paradigm also requires us to occasionally dance around areas where the original sockets architecture is on shaky ground. A telling example of this is the unfortunate, but now irrevocable, decision to combine the notions of address family and protocol family.


2 Intended Audience


This document is targeted at persons who are familiar with the sockets network programming paradigm in general and, to a lesser degree, the Windows Sockets version 1.1 interface in particular. For an introduction to WinSock programming please refer to one or more of the excellent references cited in Appendix D. For Further Reference..
Persons who are interested in developing applications that will take advantage of WinSock 2’s capabilities will be primarily interested in this API specification. Persons who are interested in making a particular transport protocol available under the WinSock 2 interface will need to be familiar with the WinSock 2 Service Provider Interface (SPI) Specification as well. The Windows Sockets 2 SPI specification exists under separate cover.

3 Document Organization


The complete Windows Sockets 2 specification consists of four separate documents:

  1. Windows Sockets 2 Application Programming Interface

  2. Windows Sockets 2 Protocol-Specific Annex

  3. Windows Sockets 2 Service Provider Interface

  4. Windows Sockets 2 Debug-Trace DLL

This document (Windows Sockets 2 Application Programming Interface) is divided into four main sections and four appendices.




Section 1

Introductory material about the specification as a whole

Section 2

Summary of additions and changes in going from Windows Sockets 1.1 to Windows Sockets 2

Section 3

Windows Sockets Programming Considerations

Section 4

Detailed reference information for the data transport functions

Section 5

Introductory material and detailed reference information for the name resolution and registration functions

Appendix A

Information on WinSock header files, error codes and data type definitions

Appendix B

Details on multipoint and multicast features in Windows Sockets 2

Appendix C

The WinSock Lame List

Appendix D

A bibliography for those seeking additional information

The Windows Sockets 2 Protocol-Specific Annex contains information specific to a number of transport protocols that are accessible via Windows Sockets 2. The Windows Sockets 2 Service Provider Interface specifies the interface that transport providers must conform to in order to be accessible via Windows Sockets 2. Windows Sockets 2 Debug-Trace DLL describes the files and mechanics of the debug-trace DLL. This is a useful tool for application developers and service providers alike, that shows API and SPI calls in and out of the WinSock 2 DLL..




Download 1.64 Mb.

Share with your friends:
1   2   3   4   5   6   7   8   9   ...   49




The database is protected by copyright ©ininet.org 2024
send message

    Main page