sockaddr.com
What's A WinSock?


WinSock is a network application programming interface (API) for Microsoft Windows; a well-defined set of data structures and function calls implemented as a dynamic link library (DLL).

WinSock is a translator of sorts. In your application, you make function calls requesting generic network services (like send() and receive()); WinSock translates these generic requests into protocol-specific requests and performs the necessary tasks. Residing between your application and the network implementation, WinSock shields you from the details of low-level network protocols (see Figure 1-1).


Figure 1-1: WinSock shields your application from implementation-specific details.

Before WinSock was established, each network provider developed its own interface libraries independently. The general framework and calling conventions of network applications varied greatly. Software developers were left with the daunting task of trying to code for each unique network interface. The interfaces were distinct even among equivalent network protocols and topologies. An application developed for one vendor’s TCP/IP implementation wouldn’t necessarily work on a TCP/IP network provided by a different vendor.

The WinSock specification changed all that. A group of over 30 network providers have agreed upon WinSock as an open standard. This standard gives the application programmer a single interface to network functionality. It clearly defines which duties are assigned to the network vendor’s software and which ones are left to the application.

The effort was started by Martin Hall of JSB Corp. at the Fall ’91 Interop conference. Hall and others organized a "birds-of-a-feather" group which quickly became the formal WinSock Group. This assembly of developers and network providers sought to establish a standard API for TCP/IP under Windows. They also wanted to provide for future support of additional transport protocols.

The resulting WinSock API provides not only a source code standard, but a binary standard as well. A WinSock-compliant application can run unchanged on any WinSock-compatible implementation without even being recompiled (see Figure 1-2).


Figure 1-2: WinSock-compliant applications will run on any vendor’s software.

Most of the existing WinSock applications you’ll find were developed for the Internet. Even though WinSock was originally developed primarily for TCP/IP, the API is abstract enough to support other protocol families. Most WinSock 1.1 implementations only provide support for TCP/IP. WinSock 2 formally supports TCP/IP, IPX/SPX, DecNet, and OSI, and expands the API to allow other protocols to be hooked in at a later date. WinSock 2 applications can even be entirely protocol independent. Using WinSock 2 services, an application that is moved from one environment to another can adapt to differences in network addressing and naming schemes.

Acceptance of WinSock

WinSock has been extremely successful since it was released in 1992. As customer demands for interconnectivity grew, providers of network hardware and software began to realize the necessity of cooperation and open standards. Closed, proprietary standards started to lose ground in the marketplace. When heavyweights such as Microsoft, Novell, IBM, Sun, 3Com, Hewlett-Packard, DEC, and others joined the WinSock group, WinSock’s acceptance was virtually assured.

Microsoft was a founding member of the WinSock group and has since changed its network communications strategy from NetBIOS to WinSock. The Windows Open Services Architecture (WOSA) incorporates WinSock as a part of Microsoft's suite of open APIs.

WinSock is greatly responsible for the growth of the World Wide Web. Microsoft had already populated the world with Windows desktop PCs by the time plans for the Web started to take shape, and these PCs provided an abundant, inexpensive, natural environment for the Web’s graphical hypertext model. Indeed, the Windows version of Mosaic, the first Web browser, was built with WinSock. Virtually all popular Internet applications now use WinSock, including Netscape’s Web browser, Microsoft’s Internet Explorer, e-mail programs, Usenet readers, and other related software.

More About WinSock:
The Files You Need | The Sockets Paradigm | Version Differences


Home | Example Source Code | WinSock Specifications | Development Files | Related Links