Winsock Programmer's
General Winsock Information

1.1 - What is Winsock?

The Windows Sockets (abbreviated "Winsock" or "WinSock") specification defines a network programming interface for Microsoft Windows which is based on the "socket" paradigm popularized in BSD Unix. It encompasses both familiar Berkeley socket style routines and a set of Windows-specific extensions:

  1. Winsock 1 apps can ask Winsock to send notifications in window messages. This allows your program to handle both the network, UI issues, and background processing without having to worry about concurrency.
  2. Winsock 2 adds many features.

Winsock 2.x defines two interfaces: an application programming interface (API) which shields application developers from underlying layers, and a service provider interface (SPI) which allows transparent extensions to a Winsock stack. Through proper use of the API, a Winsock application can work over various network transport protocols and Winsock implementations.

(By the way, most people just say "Winsock 2" when speaking of the current version of Winsock, because the newer versions just contain edits and clarifications to the original spec.)

You should get a copy of the API specification if you plan on programming for Winsock.

1.2 - Usepful web pages.

There are a number of other helpful web pages out there with Winsock information and code. Here are some that I think you will find most helpful.

If you find a site that you think should be linked here, please pass the URL along. I may not use it because I prefer to keep this list small and focused, but if the site meets my criteria, I'll be happy to add its URL below.

  • Sockets.com is the premier starting point for Winsock investigations. Much of its content is based on the book Windows Sockets Network Programming.
  • Stardust Technologies hosts the Winsock Resource Center and the Winsock2 Mailing List Archive. In some ways, it has more information than sockets.com, but it tends to lag behind the leading edge.
  • RamG's VBWinsock Page should be helpful to all of you VB Winsockers out there.
  • Ed Snible's Windows Sockets Programming has a few gems, but it appears to be dead (i.e. present, but not moving :) ).
  • The excellent MFC Programmer's Sourceook site has two sections with some good Winsock code: the Internet and Network Programming sections. The former concentrates on pure Winsock stuff, with a leaning towards MFC-based code. The latter page is broader, covering all sorts of other networking standards, like NetWare and Microsoft RAS.
1.3 - What newsgroups and mailing lists exist for Winsock and TCP/IP?

The main Winsock newsgroups are comp.os.ms-windows.programmer.tools.winsock and alt.winsock.programming. These only cover Windows network programming issues. Due to TCP/IP's popularity, most of the questions have to do with TCP/IP, but questions about other network protocols are appropriate.

The main TCP/IP newsgroup is comp.protocols.tcp-ip. It is much broader in scope than the Winsock newsgroups: you will find discussions on network management strategies, Unix network programming, the odd interactions between DNS client X and DNS server Y, and other things that have nothing to do with Winsock.

You may also be interested in joining the Winsock 2 mailing list. This is a low-volume mailing list (10 messages a day or so) with many true Winsock experts on it.

If you are implementing an email program (SMTP, POP, IMAP), an FTP program, or a web program (HTTP), Craig Morrison has set up several mailing lists that you may be interested in joining.

If you have questions about common protocol like those above or another common Internet protocol, see this FAQ item for pointers to resources you should find helpful.

Before posting questions to Usenet newsgroups or to mailing lists, search the relevant archives to see if your question has already been asked. Newsgroup and mailing list subscribers tend to be impatient with people who don't do this: it's a waste of their time to point you to places where you could have found the answer on your own. The Winsock 2 mailing list archives go back to the middle of 1996. Usenet also has several archives, the most popular being DejaNews.