Windows Socket Programming Tutorials
for CPSC 463 - Networks and Distributed Systems

This website contains several tutorials designed to introduce the basic concepts of windows socket programming.  The tutorials are written in C and C++ and run under Windows 95 and Windows NT.  The tutorials are designed for individuals who are competent in C and with rudimentary knowledge of Windows programming techniques.  Knowledge of the Berkely Sockets API is extremely helpful.  All tutorials were written with Visual C++ 4.0. 


About the WinSock API

The WinSock Application Programming Interface (WinSock API) is derived from the Berkely Sockets API.  This makes WinSock code easily portable to other platforms, due to the wide popularity of Berkely Sockets.  Most current versions of the WinSock API only support TCP/IP.  WinSock is the preferred way to implement TCP/IP communications in the MS Windows environment.  Future versions of WinSock will support other protocols such as IPX/SPX. 

The most popular and widely distributed version of WinSock is currently version 1.1.  This version provides most of the Berkely Sockets functionality, however, some parts are missing.  Version 1.1 also leaves some things to be desired such as multi-casting and multiple TCP/IP stacks.  However, WinSock 1.1 provides more than enough functionality to produce efficient network applications. 


Tutorials 
Winsock1  A very simple example to get you started.  Demonstrates the fundamentals of sending TCP and UDP packets. 
Winsock2  A more advanced app that covers UDP, TCP, and broadcasting.  This single app acts as both the client and the server. 
Winsock3  A multi-threaded app that automatically detects and lists all other hosts running Winsock3.  Uses TCP and UDP. 
Winsock4  A fully functional chat application.  Uses TCP and UDP. 


Downloads 
Complete Winsock Tutorial (Programs Only)  Complete set of Winsock Tutorial EXE's (7 total).  No source files. 
Complete Winsock Tutorial (Programs and Source Files) Complete set of Winsock Tutorial EXE's, source files and project files.
Note:  You must unzip these files with subdirectories!  (example:  "pkunzip -d ws1_full.zip") 



Related Information 
TCP/IP for Windows 95 and Windows NT 4.0  This will show you how to ensure that TCP/IP is properly configured for your LAN card.  You 
must have TCP/IP set up properly for these WinSock tutorials to work correctly. 
General Purpose Winsock Utility Functions  These functions are used by all the WinSock tutorials.  They provide a convenient way to handle 
commonly used Winsock APIs. 
Modeless Message Box  This is a simple derived class that implements a modeless message box.  It is a helpful tool to show 
messages to the user when the application is executing a blocking call.  This is used often by the 
WinSock Tutorials. 
Links  Links to other sockets and network information pages. 


This website and the programming tutorials contained within were created by Gage Galinger as an independent study course for CPSC 463 - Networks and Distributed Systems. 

Last Updated May 15, 1997.