---------------------------------------------------------------------
_Windows Sockets Network Programming_ by Bob Quinn and Dave Shute,
published by Addison-Wesley, Reading, MA ISBN: 0-201-63372-8
---------------------------------------------------------------------
Welcome! This is the "readme" file for the Windows Sockets samples
disk that accompanies _Windows Sockets Network Programming_. This
file contains:
- Installation Notes
- Names of installed directories and their contents
- Descriptions of each of the six sample WinSock applications
- Description of the sample DLL over WinSock
- Description of the sample WinSock subroutine library
This is not the only documentation on this disk. The index.htm
file in the webpage directory has the contents of this file and a
lot of other useful information in hypertext (HTML) format. You
can use any Internet browser application like Mosaic or Netscape
to access this hypertext documentation.
Note: Everything on this disk and more are also available from our
web page on the Internet at http://www.sockets.com Please email
your comments, suggestions and bug resports to webmaster@sockets.com
--------------------------------------------------------------------
Installation Notes:
-------------------
- If you use this installation program to install the samples on
Windows NT, the program aborts when it attempts to place the
icons in the group box. This is after all the files have been
copied, so you can use the Program Manager File/New/Program Item
command to add the icons manually. Most of them run the 16 and
32-bit applications installed in the "BIN" directory. The icons
are as follows (replace the directory "C:\WSA" with the path you
used during installation of the samples):
Description Command Line
----------- ------------
ac_ftp C:\WSA\BIN\AC_FTP.EXE
as_echo C:\WSA\BIN\AS_ECHO.EXE
multitst C:\WSA\BIN\MULTITST.EXE
simpltst C:\WSA\BIN\SIMPLTST.EXE
ua_time C:\WSA\BIN\UA_TIME.EXE
wal C:\WSA\BIN\WAL
ac_ftp32 C:\WSA\BIN\AC_FTP32.EXE
asecho32 C:\WSA\BIN\ASECHO32.EXE
multi_32 C:\WSA\BIN\MULTI_32.EXE
simplt32 C:\WSA\BIN\SIMPLT32.EXE
uatime32 C:\WSA\BIN\UATIME32.EXE
wal32 C:\WSA\BIN\WAL32
readme notepad C:\WSA\BIN\ECHO.LOG
echo.log notepad C:\WSA\BIN\ECHO.LOG
ftp.log notepad C:\WSA\BIN\FTP.LOG
WinSock 1.1 winhelp C:\WSA\WINSOCK.HLP
- If you are running 16-bit Windows (versions 3.0, 3.1 or 3.11),
and you do NOT have Win32s--the 32-bit emulator--installed,
then you cannot run the 32-bit versions of each application
(and Windows will identify each as a non-Windows MS-DOS appli-
cation, and assign an MS-DOS icon accordingly).
- If you run setup.exe more than once, it will create duplicate
icons for each entry in the WinSock Samples program group.
--------------------------------------------------------------------
Contents of Each Directory
--------------------------
Assuming you installed the Windows Sockets samples in a directory
named "WSA", the subdirectories and their contents are as follows:
WSA - Windows Sockets development files (.H, .LIB, etc.)
WSA\AC_FTP - source code for a ftp client application (TCP)
WSA\AS_ECHO - source code for a echo server application (TCP)
WSA\BIN - 16 and 32-bit executables for all samples
WSA\MULTITST - source code for UDP multicast and ICMP ping
WSA\UA_TIME - source code for a daytime client and server (UDP)
WSA\WAL - a flexible WinSock tester application (UDP & TCP)
WSA\WEB - hypertext documentation in HTML format
WSA\WINSOCKX - sample WinSock subroutines used by samples
WSA\WSASIMPL - source code for a DLL over WinSock that provides
a simplified WinSock API, and source code for a
simple echo client application that uses it.
---------------------------------------------------------------------
Sample Applications
-------------------
All but one of the sample applications available here are used
as examples in the text _Windows Sockets Network Programming_.
- AC_FTP.EXE: FTP client application (asynchronous operation
mode with a TCP socket)
- AS_ECHO.EXE: echo server application (asynchronous operation
mode with a TCP socket)
- UA_TIME.EXE: daytime client and server application (asynchronous
operation mode with a UDP socket)
- MULTITST.EXE: optional features test application (asynchronous
multicast UDP and SOCK_RAW ICMP ping)
- WAL.EXE: flexible WinSock implementation test, exploration, and
benchmark tool (not pretty, but does everything)
We used Microsoft Visual C++ enviroments (versions 1.52 for 16-bit,
and version 2.1 for 32-bit) to create most of the makefiles.
Unfortunately, because the paths are hard-coded in the file, you will
have to bring the project files (.mak) into the respective MS C++
environments to readjust things to the new directory, and even then
you will have to manually alter the project to access the library
files (the are in the root of the directory where you install the
samples).
All samples--including the sample DLL and static library--have a
number of other things in common:
- They all have 32-bit versions, and all 32-bit version names
end with "32" (16-bit versions don't have a number).
- They use the WSAperror() function from #WINSOCKX">WINSOCKX.LIB
to display error values and short descriptions when an unexpected
error occurs.
- They display error messages on any suspicious error condition.
They don't hide errors, but report them whenever they occur. As
we describe n a_c.htm">Appendix C: WinSock Error Reference,
these error messages should appear only when a "user fixable
error" occurs. If you get an error message from a sample
application for a non user-fixable error, then this may
indicate an anomoly in the WinSock implementation that your applications
may need to deal with. We show you the errors on purpose, to make
you aware of unexpected conditions.
- They have a minimal user interface, and do not have help (.HLP)
files available.
- They are meant to be played with. They are for exploration
and experimentation as well as to illustrate how to write WinSock
applications.
The icons used for each sample don't mean much, but they meet
the following three criteria:
- They each contain the socket from the official WinSock icon.
- Each one is colorful in its own unique and wonderful way.
- Each took under 10 minutes to create.
------------------------------------------------------------------------
AC_FTP.EXE: file transfer protocol client application
-----------------------------------------------------
This application is described in detail in Chapter 7, "Sample
Application and Library."
What it does: AC_FTP is a file transfer protocol client
that uses asynchronous socket operation mode and utilizes many
programming techniques described in detail throughout the book.
It connects to an FTP server, sends commands and receives replies
according to rfc959.txt">RFC 959 to get and put files,
change directories, get file lists, delete files.
What it illustrates: The source code for AC_FTP illustrates
many key aspects of WinSock application programming, including
how to connect as a TCP client and as a server, how to maximize
data throughput using sockets with asynchronous operation mode.
It also demonstrates how to receive variable length data on a
stream connection; this is often a problem since TCP (rfc793.txt">RFC 793
and rfc1122.txt">RFC 1122) does not preserve packet
boundaries. It also shows how to implement an application pr