sockaddr.com
Example Source Code


Example programs from the book WinSock 2.0
Covers programming with version 1.1 and version 2 of WinSock.

WinSock 1.1
  Programming with Sockets (Chapter 2)
  Makeword.h
Needed only if you are programming on Windows 3.1
  WSVer.zip
Win32 console program that prints WinSock version information to stdout
  DataGram.zip
Very simple datagram client and server console applications.
  Stream.zip
Very simple stream client and server console applications.
  HostInfo.zip
Console utility used to retrieve host information.
  GetHTTP.zip
Console utility used to retrieve files from a HTTP server.
  Using Asynchronous Mode (Chapter 4)
  CheckMail.zip
Windows GUI program that checks for the availability of POP mail.
  Optional Features (Chapter 5)
  Ping.zip
Ping program using ICMP and RAW sockets.
  PingI.zip
Ping program using Microsoft's proprietary ICMP API
  MFC Socket Classes (Chapter 6)
  SendMail.zip
SMTP Client that sends e-mail using the MFC CSocket class.
  WSTerm.zip
TCP/IP terminal utility that uses the Microsoft CAsyncSocket class.
WinSock 2 (Requires Windows NT version 4 or higher, Windows 98, or Windows 95 with the WinSock 2 SDK installed.)
  Introduction to WinSock 2 (Chapter 7)
  EnumProtocol.zip
Win32 program that displays detailed information for all installed protocols and protocol chains.
  SelProtocol.zip
General purpose protocol selection function and example program.
  Name Registration and Resolution (Chapter 8)
  Services.zip
MFC program that uses WinSock 2 Name Resolution API to display information for host names and services.
  Enhanced Input/Output(Chapter 9)
  GetHTTP2.zip
Console utility that retrieves a file from a HTTP server using event objects and WSASelectEvent() for asynchronous notification.
  GetHTTP3.zip
Console utility that retrieves a file from a HTTP server using overlapped I/O functions.
Advanced Examples (Require WinSock 1.1 or 2 as noted)
  Asynchronous Server (Chapter 10)
  HTTPa.zip
Asynchronous mode HTTP server. Works with WinSock 1.1 or 2 and any version of Windows -- 3.1 and above.
  Multi-Threaded Server (Chapter 11)
  HTTPmt.zip
Multi-threaded HTTP server that uses blocking sockets, overlapped I/O and client threads to handle multiple simultaneous connections. (Requires WinSock 2)
  Protocol Independent Client and Server (Chapter 12)
  SocketAdapter.zip
Library of C functions that allows a program to use WinSock 2 functionality if it is available or fall back to WinSock 1.1 if it isn't.
  Echo.zip
Multi-protocol ECHO client and server applications that use the above SocketAdapter library. These programs can use any of the advanced features of WinSock 2 when they are available yet still run when only WinSock 1.1 is installed.

Home | WinSock Specifications | Development Files | Related Links