In computing, the Windows Sockets API, which was later shortened to Winsock, is a technical specification that defines how Windows network software should access network services, especially TCP/IP. It defines a standard interface between a Windows TCP/IP client application (such as an FTP client or a Gopher client) and the underlying TCP/IP protocol stack. The nomenclature is based on the Berkeley sockets API model used in Berkeley UNIX for communications between programs. Initially, all the participating developers resisted the shortening of the name to Winsock for a long time, since there was much confusion among users between the API and the DLL library file (winsock.dll) which only exposed the common WSA interfaces to applications above it. Users would commonly believe that only making sure the DLL file was present on a system would provide full TCP/IP protocol support.


Early Microsoft operating systems, both MS-DOS and Microsoft Windows, offered limited networking capability, chiefly based on NetBIOS|NetBIOS/NetBEUI.

In particular, Microsoft completely ignored the TCP/IP protocol stack at that time. A number of university groups and commercial vendors, including the PC/IP group at MIT, FTP Software, Sun Microsystems, Ungermann-Bass, and Excelan, introduced TCP/IP products for MS-DOS, often as part of a hardware/software bundle.

When Microsoft Windows 2.0 was released, these vendors were joined by others such as Distinct and NetManage in offering TCP/IP for Windows. The drawback faced by all of these vendors was that each of them used their own API (Application Programming Interface).

Without a single standard programming model, it was difficult to persuade independent software developers to create networking applications which would work with any vendor’s underlying TCP/IP implementation. Add to this the fact that end users were wary of getting locked in to a single vendor and it becomes clear that some "standardisation" work was needed.

In November of 1990 Lynn "Jess" Jessop then the Director of Engineering for ICL North America met with Rob Barrow, the B in JSB, and Steve Jones, the J in JSB, at his Reston Virginia ICL office. At the time Jess's main product Officepower ran over TCP/IP and on Windows 2.0 using Visionware’s desktop. But that required supporting seven different flavors of TCI/IP and updating TSR programs each time one of the vendor came out with a new version of their stack.

Rob wanted Jess to adopt JSB's desktop as the underlying technology instead of Visonware. Jess told Rob what he wanted was a Berkeley Socket like interface on the Windows desktop, not another desktop on a desktop as it currently was.

ICL being the open standards leader in the world, Jess wanted it to be an open standard. That he told Rob he would buy. Rob agreed and took the idea back to England. Jess visited Rob at JSB Headquarters in England in December and was introduced to Martin Hall.

Martin invited Jess to his home for dinner, a long night of discussion over many bottles of wine and Martin was up to speed. Jess, Rob and Martin continued to work on the initial design and started expanded the group.

Although ICL's and Jess Jessop's part is often left out of the official histories Jess represented ICL as a founding member of the original Winsock committee, edited the first three drafts and attended the initial sessions. When it was clear the project was well underway and transferred to JSB's offices in Scott's Valley California Jess left ICL and withdrew from the committee.

The Windows Sockets API was proposed by Martin Hall of JSB Software (later Stardust Technologies) as a BoF (Birds of a Feather) discussion on the CompuServe BBS network in October 1991. The first edition of the specification was authored by Martin Hall, Mark Towfiq of Microdyne (later Sun Microsystems), Geoff Arnold of Sun Microsystems, and Henry Sanders and J Allard of Microsoft, with assistance from many others. There was some discussion about how best to address the copyright, intellectual property, and potential anti-trust issues, and consideration was given to working through the IETF or establishing a non-profit foundation. In the end, it was decided that the specification would simply be copyrighted by the five authors as (unaffiliated) individuals. (J Allard was later granted a large corner office at the Microsoft "campus" in which he kept two live Iguanas, STOCK and OPTION, as they were aptly named).


The Windows Sockets API specification defines two interfaces: the API used by application developers, and the SPI, which provides a means for network software developers to add new protocol modules to the system. Each interface represents a contract. The API guarantees that a conforming application will function correctly with a conformant protocol implementation from any network software vendor. The SPI contract guarantees that a conforming protocol module may be added to Windows and will thereby be usable by an API-conformant application. Although these contracts were important when Windows Sockets was first released, as network environments required multi-protocol support (see above) they are now of only academic interest. Included in the Windows Sockets API version 2.0 are functions to use IPX/SPX, but no commercial application is known to exist which utilises this transport, since the protocol was all but obsolete already at the time WSA 2.0 shipped. Microsoft has shipped a high-quality TCP/IP stack with all recent versions of Windows, and there are no significant independent alternatives. Nor has there been significant interest in implementing protocols other than TCP/IP.

Windows Sockets is based on BSD sockets, but provides additional functionality to allow the API to comply with the standard Windows programming model. The Windows Sockets API covered almost all the features of the BSD sockets API, but there were some unavoidable obstacles which mostly arose out of fundamental differences between Windows and Unix (though to be fair Windows Sockets differed less from BSD sockets than the latter did from STREAMS). All function calls in the API begin with the moniker WSA, e.g. WSAGetHostByName() for making a hostname lookup. It should also be noted that Windows Sockets expanded on BSD Sockets functionality, by offering "non-blocking" or asynchronous Sockets (accessed by adding WSAAsync before the desired function; e.g., WSAAsyncGetHostByName())

However it was a design goal of Windows Sockets that it should be relatively easy for developers to port socket-based applications from Unix to Windows. It was not considered sufficient to create an API which was only useful for newly-written Windows programs. For this reason, Windows Sockets included a number of elements which were designed to facilitate porting. For example, Unix applications were able to use the same errno variable to record both networking errors and errors detected within standard C library functions. Since this was not possible in Windows, Windows Sockets introduced a dedicated function, WSAGetLastError(), to retrieve error information. Such mechanisms were helpful, but application porting remained extremely complex. Many "traditional" TCP/IP applications had been implemented by using system features specific to Unix, such as pseudo terminals and the fork system call, and reproducing such functionality in Windows was problematic. Within a relatively short time, porting gave way to the development of dedicated Windows applications.


* Version 1.0 (June 1992) defined the basic operation of Winsock. It was kept very close to the existing interface of Berkeley sockets to simplify porting of existing applications. A few Windows-specific extensions were added, mainly for asynchronous operations with message-based notifications.: Although the document didn't limit support to TCP/IP, TCP and UDP were the only protocols explicitly mentioned. Most vendors only delivered TCP/IP support, although Winsock from DEC included DECNet support as well.

* Version 1.1 (January 1993) made many minor corrections and clarifications of the specification. The most significant change was the inclusion of the gethostname() function.

* Winsock 2 was a backwards-compatible extension of Winsock 1.1. It added support for protocol-independent name resolution, asynchronous operations with event-based notifications and completion routines, layered protocol implementations, multicasting, and quality of service. It also formalized support for multiple protocols, including IPX/SPX and DECnet. The new specification allowed sockets to be optionally shared between processes, incoming connection requests to be conditionally accepted, and certain operations to be performed on socket groups rather than individual sockets. Although the new specification differed substantially from Winsock 1, it provided source- and binary-level compatibility with the Winsock 1.1 API. One of the lesser known additions was the Service Provider Interface (SPI) API and Layered Service Providers.
* Versions 2.0.x (May 1994 onwards) had internal draft status, and were not announced as public standards.
* Version 2.1.0 (January 1996) was the first public release of the Winsock 2 specification.
* Version 2.2.0 (May 1996) included many minor corrections, clarifications, and usage recommendations. It was also the first version to remove support for 16-bit Windows applications.
* Version 2.2.1 (May 1997) and Version 2.2.2 (August 1997) introduced minor functionality enhancements. Mechanisms were added for querying and receiving notification of changes in network and system configuration.

* The IPv6 Technical Preview for Windows 2000 (December 2000) saw the first implementation of (March 1999, later obsoleted by ), a protocol-independent API for name resolution, which would become part of Winsock in Windows XP.


Microsoft implementations

* Microsoft did not supply an implementation of Winsock 1.0.

* Version 1.1 of Winsock was supplied in an add-on package (called Wolverine) for Windows for Workgroups (code named Snowball). It was an integral component of Windows 95 and Windows NT 3.x.

* Version 2 of Winsock was supplied in an add-on package for Windows 95. It was an integral component of Windows 98, Windows NT 4.0, and all subsequent Windows releases. (Microsoft did not supply implementations of Winsock 2 for Windows 3.x or Windows NT 3.x.)

* Recent versions of Winsock 2.x have been delivered with new Windows releases or as part of service packs.

* Winsock 2 is extensible by a mechanism known as a Layered Service Provider (LSP). Winsock LSPs are available for a wide range of useful purposes, including internet parental controls, web content filtering, QoS etc. The layering order of all providers is kept in the Winsock Catalog. In previous versions of Windows, removing a buggy LSP could result in corruption of the Winsock catalog in the registry, potentially resulting in a loss of "all network connectivity". Winsock in Windows XP Service Pack 2, Windows Server 2003 Service Pack 1 and all later Windows operating systems has the ability to self-heal after a user uninstalls such an LSP.

Other implementations

* Among the other vendors offering Winsock-compliant TCP/IP stacks were (alphabetically) 3Com, Beame & Whiteside, DEC, Distinct, FTP Software, Frontier, IBM, Microdyne, NetManage, Novell, Sun Microsystems and Trumpet Software International

* Trumpet Winsock was one of the few Winsock 1.0 implementations that could be installed under Windows 3.0, which had no built-in support for Winsock. Trumpet was also the most popular shareware implementation of Winsock for Windows 3.x. Trumpet Winsock 5.0 is available for Windows 95/98 and Windows NT and includes a Winsock 1.1 compliant IPv6 stack for these operating systems. [ [ Trumpet Winsock v5.0] ]


Originally adapted from: Aboba, Bernard D., comp.protocols.tcp-ip.ibmpc, Frequently Asked Questions, 1993. Usenet: news:news.answers. Thanks to

ee also

*Layered Service Provider (Winsock LSP)
*Berkeley sockets


External links

* [ Windows Sockets] - Open Source Implementation of a client & server windows sockets in C#
* [ Sockets FAQ] - Windows Sockets FAQ
* [ Client / Server Programming with TCP/IP Sockets] - WinSock C++ Programming
* [ Komodia's open source Windows based C++ TCP/IP socket library]


* [ MSDN - Winsock2 Reference]
* [ MSDN - Winsock2 Home]
* [ Porting Berkley Socket programs to Winsock]
* [ Windows Network Development blog] — Microsoft developer blog covering Winsock, WSK, WinINet, Http.sys, WinHttp, QoS and System.Net, with a focus on features being introduced in Windows Vista
* [ Brief History of Microsoft on the Web]


* [ WinSock error codes list] with descriptions
* [ WinSock Development Information]
* [ Winsock Programmer's FAQ]

Wikimedia Foundation. 2010.

Look at other dictionaries:

  • Winsock — (WINdows SOCKet) est une bibliothèque dynamique de fonctions DLL sous Windows dont le but est d implémenter TCP/IP. Elle prend notamment en charge l envoi et la réception des paquets de données via des socket BSD. Les applications qui utilisent… …   Wikipédia en Français

  • Winsock — oder Windows Sockets bezeichnet eine Funktionssammlung zum Zugriff auf Netzwerkkomponenten unter Microsoft Windows. Winsock ergänzt Windows um die Internetprotokollfamilie und ist für die Verbindung des PCs mit dem Internet zuständig. Es wird von …   Deutsch Wikipedia

  • Winsock — (WINdowsSOCKet) es una biblioteca dinámica de funciones DLL para Windows que se hizo con la finalidad de implementar TCP/IP. Incluye soporte para envío y recepción de paquetes de datos a través de sockets BSD. Las aplicaciones que utilizan… …   Wikipedia Español

  • Winsock —   [Abk. für Windows Sockets, dt. »Sockel für Windows«], in den Betriebssystemen Windows 95, Windows 98, Windows NT und Windows 2000 enthaltenes Application Programming Interface (API), das eine Kommunikation zwischen zwei Anwendungsprogrammen… …   Universal-Lexikon

  • Winsock — Windows Sockets API (WSA), название которого было укорочено до Winsock. Это техническая спецификация, которая определяет, как сетевое программное обеспечение Windows будет получать доступ к сетевым сервисам, в том числе, TCP/IP. Он определяет… …   Википедия

  • WinSock —    An API for writers of TCP/IPrelated software. Also known as Windows Sockets or Windows Network Transit Protocol.    WinSock is designed to provide the same kinds of services that Berkeley sockets provide in the Unix world. In Windows, WinSock… …   Dictionary of networking

  • Winsock — noun The Windows interface to TCP/IP …   Wiktionary

  • WINSOCK — Windows Sockets (implementation) …   Acronyms

  • winsock — ● ►en np. ►NET Windows Sockets. Une fameuse DLL sous Windows qui permet d utiliser des sockets TCP/IP …   Dictionnaire d'informatique francophone

  • WINSOCK — Windows Sockets (implementation) …   Acronyms von A bis Z

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”

We are using cookies for the best presentation of our site. Continuing to use this site, you agree with this.