Sample: Demonstration of the Windows Sockets API

Summary:
This sample demonstrates the basics of sockets programming, specifically
for Windows Sockets.  It demonstrates how to accept incoming connections
(via the Windows Sockets Asynchronous Extension APIs, threads and
traditional BSD-style blocking calls) and connect to remote hosts.
Once connected the user can send a text string to the remote host.
WSOCK also allows the user to view information on a user-entered host 
name.

More Information:

In order for the program to operate correctly, the TCP/IP protocol must
be properly installed.  Also, if two machines over a network are used,
the "hosts" file must contain both machine names and IP addresses.


WSOCK can run on a single machine (execute two copies of WSOCK) or over 
a network with two Win32 machines.  The following example explains how
two separate machines over a network would test WSOCK.

 A.) Machine "Bob" executes a copy of WSOCK.

 B.) Machine "Fred" executes a copy of WSOCK.

 C.) Machine "Bob" chooses one of the Listen menu options (under WinSock)
     (Listen (Blocking), Listen with threads, or Async Listen)

 E.) Machine "Fred" chooses the Connect menu option (under WinSock)

 F.) Machine "Bob" enters "12" as a TCP port number.
 G.) Machine "Bob" waits for a connection.
 
 H.) Machine "Fred" enters "Bob" as the host name in which to connect.
 I.) Machine "Fred" enters "12" as a TCP port number.

 J.) Both machines are now connected and can send strings back and forth
     by using the WinSock, Send Message menu option.

 If "Bob" exits WSOCK while there is a connection, "Fred" will receive
 a message box notification.

Windows Sockets Calls used:

accept
closesocket
connect
gethostbyname
getservbyname
htons
listen
send
recv
WSAAsyncSelect
WSACleanup
WSAStartup


