Tenouk - A complete C language, Win32 & Winsock 2 references

The Tenouk's Winsock, the Windows Socket (network) programming tutorial. Learn Windows native networking while mastering the C programming language. Investigate the fundamental on how the Windows client/server communicates



Master and Learn C Programming in Several Days!


C & C++ Libraries, Toolkits, APIs, Components etc.


Use Your C/C++ Skills in The C/C++ Challenge


C Code Listing ~ 340 C code samples


C++ Code Listing ~ 500 C++ code Samples


C & Linux Device Driver (ext)


C & C++ CERT Secure Coding Standards


Java programming resources and its' open source friends


C#, VB .NET & C++/CLI Winsock/ Socket/Network Programming Tutorials



A Complete, Advanced Winsock2 & C Programming


C and C++ Code Sample Index






This tutorial introduces the using of C language in Windows Socket (Winsock) programming. It should be in Win32 category, Windows network programming. For C++ Winsock programming you have to find it in Microsoft Foundation Class (MFC) programming reference. The new Application Programming Interface (API) has been introduced in Winsock version 2. As mentioned in the MSDN documentation, the Winsock Service Provider Interface, or Winsock SPI (WSP), is a specialized discipline of Winsock used to create providers; transport providers such as TCP/IP or IPX/SPX (Novell Netware -





C/C++ Standards


Using C/C++ Compilers


C/C++ Tutorial


C and Win32 Tutorial


C and Winsock2 Tutorial


C, Winsock 2 and IPv6 Tutorial


C and Linux Socket Tutorial


C++ and Object Oriented Idea


C and C++ Standard Library Online Documentation


C/C++ and Buffer Overflow


C++ and Standard Template Library (STL)


C++ and Microsoft Foundation Class (MFC)


C++ and Microsoft Foundation Class (MFC) - Advanced Topics


C++, Winsock, WinInet and MFC


::Visual C++ .NET 2003/2005 Express/Visual Studio::


C and Linux Programming - advanced


Search C & C++ Source Codes, Programs


 already dead) protocol internet's Domain Naming System (DNS). In Traditional network programming, such as enabling applications to communicate over the network, does not require the use of Winsock SPI interfaces; use standard Winsock (WSA - Winsock API) interfaces instead that looks just like Linux Socket. The Winsock or socket programming is one of the sought after topic in programming because of the TCP/IP protocol suite used in the booming Internet communication. A more complete computer network story, specific to TCP/IP, using GNU C programming is discussed in Linux Socket tutorial. At the end you will notice that the C programming for Winsock 1 (WSA) is quite similar to Linux socket programming. The .NET version for Windows network programming with C++/CLI, C# and VB .NET code and project samples can be found on the left sidebar link. Also available is the Java GUI programming which demonstrates some of the TCP/IP elements. Start playing with Windows socket now...





C and Winsock2 Topics


The Winsock Story


This part provides the fundamental information about Winsock/Winsock2 that includes APIs used, WSA, WSP, handles, protocols and programming considerations. This is the user side Winsock programming. For kernel side, please refer to Winsock Kernel (WSK) and the WSK Reference Guide.

  1. Winsock Networking Story Part 1
  2. Winsock Networking Story Part 2 and
  3. Winsock Networking Story Part 3
The Winsock Working Program Examples


Here, we start C coding for Winsock. This part provides working program examples of the Winsock/Winsock2 starting from discussing the functions/APIs used in the programs then followed by the coding for server and client as well and finally testing those codes. The topics and the program examples have been arranged in the step-by-step manner which includes TCP and UDP for client and server.

  1. For Visual Studio/C++ .NET 2005-2008, please read the Visual .NET doc 1 and Visual .NET doc 2 on how to build the program examples successfully
  2. Winsock Program Example Part 1, Winsock Program Example Part 2, Winsock Program Example Part 3, Winsock Example Part 4
  3. Winsock Code Example Part 5, Winsock Code Example Part 6, Winsock Code Example Part 7, Winsock Code Example Part 8
  4. Winsock Example Part 9, Winsock Example Part 10, Winsock Example Part 11, Winsock Example Part 12
Winsock Supplementary notes


This part provides information or documentation for the functions or Winsock2 APIs used in the previous topics.

  1. Winsock Reference Part 1, Winsock Reference Part 2, Winsock Reference Part 3, Winsock Reference Part 4
  2. Winsock C and C++ Books
  3. ISO/IEC TS 19216:2018 C++ Extensions for Networking Standard


Another Complete and Advanced C & Winsock2 Programming Tutorial

Custom Search

Best viewed using IE 4.0/FireFox 1.0.0 and above but if your eyes can view the pages, that is the best resolution.

Broken link? Respond to Webmaster: [Winsock, the Windows Socket]

Copyright 2003 - 2018 © Tenouk. All rights reserved.


Hosting services by: MochaHost - JSP/Tomcat hosting from $2.95/month !

Translate, email to friends and share: